table of contents
XSetSelectionOwner(3) | XLIB FUNCTIONS | XSetSelectionOwner(3) |
NAME¶
XSetSelectionOwner, XGetSelectionOwner, XConvertSelection - manipulate window selection
SYNTAX¶
int XSetSelectionOwner(Display *display, Atom selection, Window owner, Time time);
Window XGetSelectionOwner(Display *display, Atom selection);
int XConvertSelection(Display *display, Atom selection, Atom target, Atom property, Window requestor, Time time);
ARGUMENTS¶
- display
- Specifies the connection to the X server.
- owner
- Specifies the owner of the specified selection atom.You can pass a window orNone.
- property
- Specifies the property name.You also can passNone.
- requestor
- Specifies the requestor.
- selection
- Specifies the selection atom.
- target
- Specifies the target atom.
- time
- Specifies the time.You can pass either a timestamp orCurrentTime.
DESCRIPTION¶
TheXSetSelectionOwnerfunction changes the owner and last-change time for the specified selectionand has no effect if the specified time is earlier than the currentlast-change time of the specified selectionor is later than the current X server time.Otherwise, the last-change time is set to the specified time,withCurrentTimereplaced by the current server time.If the owner window is specified asNone,then the owner of the selection becomesNone(that is, no owner).Otherwise, the owner of the selection becomes the client executingthe request.
If the new owner (whether a client orNone)is notthe same as the current owner of the selection and the currentowner is notNone,the current owner is sent aSelectionClearevent.If the client that is the owner of a selection is laterterminated (that is, its connection is closed)or if the owner window it has specified in the request is laterdestroyed,the owner of the selection automaticallyreverts toNone,but the last-change time is not affected.The selection atom is uninterpreted by the X server.XGetSelectionOwnerreturns the owner window, which is reported inSelectionRequestandSelectionClearevents.Selections are global to the X server.
XSetSelectionOwnercan generateBadAtomandBadWindowerrors.
TheXGetSelectionOwnerfunctionreturns the window ID associated with the window that currently owns thespecified selection.If no selection was specified, the function returns the constantNone.IfNoneis returned,there is no owner for the selection.
XGetSelectionOwnercan generate aBadAtomerror.
XConvertSelectionrequests that the specified selection be converted to the specified targettype:
- If the specified selection has an owner, the X server sends aSelectionRequestevent to that owner.
- If no owner for the specifiedselection exists, the X server generates aSelectionNotifyevent to therequestor with propertyNone.
The arguments are passed on unchanged in either of the events.There are two predefined selection atoms: PRIMARY and SECONDARY.
XConvertSelectioncan generateBadAtomandBadWindowerrors.
DIAGNOSTICS¶
SEE ALSO¶
Xlib - C Language X Interface
libX11 1.8.7 | X Version 11 |