The owner and the selection members will be the values specified in the XSet-SelectionOwner ( ) request, and therefore, the selection owner is interested in them only if it owns more than one selection.

The owner should convert the selection into the type specified by the target member and set the property specified by the property member of the SelectionRequest event. Current conventions hold that all properties used to reply to SelectionRequest events should be placed on the requestor window. If the data comprising the selection cannot be stored on the requestor window (for example, because the server cannot provide sufficient memory), the owner must refuse the selection request as above.

The owner should also send the requestor a SelectionNotify event using XSend-Event( ) with an event_mask of 0. The members of the SelectionNotify event should be set to the same values received in the SelectionRequest event, except that if the selection could not be converted to the requested type, the property member should be set to None. Example 12-10 shows the XSelectionEvent structure which is used for SelectionNotify events.

Example 12-10. The XSelectionEvent structure

typedef struct { int type; unsigned long serial; /* # of last request processed by

* server */

Bool send_event; /* True if this came from SendEvent

* request */

Display *display; /* Display the event was read from */ Window requestor; Atom selection; Atom target;

Atom property; /* Atom or None */ Time time; } XSelectionEvent;

The selection, target, and property members should be set to the values received in the SelectionRequest event. Setting the property member to None indicates that the conversion requested could not be made.

The data stored in the property must eventually be deleted. According to the current conventions, selection requestors are responsible for deleting the converted properties whose names they receive in SelectionNotify events. Owners are responsible for deleting all other properties involved in communicating selections.

A selection owner may need confirmation that the data comprising the selection has actually been transferred. They should express interest in PropertyNotify events for the requestor window and wait until the property in the SelectionNotify event has been deleted before assuming that the selection data has been transferred.