XtOwnSelection(), XtDisownSelection() - set selection owner
Boolean XtOwnSelection (Widget w, Atom selection, Time time,
XtConvertSelectionProc convert_proc,
XtLoseSelectionProc lose_selection,
XtSelectionDoneProc done_proc)
void XtDisownSelection (Widget w, Atom selection, Time time)
The XtOwnSelection(3) function informs the Intrinsics selection mechanism that a widget believes it owns a selection. It returns True if the widget has successfully become the owner and False otherwise. The widget might fail to become the owner if some other widget has asserted ownership at a time later than this widget. Note that widgets can lose selection ownership either because someone else asserted later ownership of the selection or because the widget voluntarily gave up ownership of the selection. Also note that the lose_selection procedure is not called if the widget fails to obtain selection ownership in the first place.
The XtDisownSelection(3) function informs the Intrinsics selection mechanism that the specified widget is to lose ownership of the selection. If the widget does not currently own the selection either because it lost the selection or because it never had the selection to begin with, XtDisownSelection(3) does nothing.
After a widget has called XtDisownSelection(3), its convert procedure is not called even if a request arrives later with a timestamp during the period that this widget owned the selection. However, its done procedure will be called if a conversion that started before the call to XtDisownSelection(3) finishes after the call to XtDisownSelection(3).
X Toolkit Intrinsics - C Language Interface
Xlib - C Language X Interface