just as we did earlier. An application can also choose to use XChangeProperty() to actually use the atom
as the property itself; XChangeProperty() adds a new property to a window's list of existing properties.
An application interested in seeking out other windows that have expressed interest in
_MYAPP_CLIENT_PROP can call XQueryTree() to start at the root window and search all of its
immediate children for those windows that have that property. The function XGetWindowProperty() can
be used to test for the existence of the property itself.
•
When an application finds a window that contains the property, it can use XSendEvent() to send an
XClientMessageEvent to that window. When sending a client message, the application can either do
what the Motif toolkit does and send a WM_PROTOCOLS message, or it can just send the
_MYAPP_CLIENT_PROP atom itself. If the program uses the first technique, the data.l[0] field of the
XClientMessageEvent data structure contains the value WM_PROTOCOLS, and the the data.l[1]
field contains _MYAPP_CLIENT_PROP. If the receiving window is part of a Motif application that has
registered a callback function for this protocol, the function is invoked. Whether or not the receiving
application is a Motif application, it can set up its own event handler to trap for the client message.
•
If the sending application wishes to send any additional data to the receiving application, it should either add
or replace the receiving window's _MYAPP_CLIENT_PROP property and upgrade ...