Zum Hauptinhalt springen

Requests: Selections and Events

SetSelectionOwner​

selection: ATOM
owner: WINDOW or None
time: TIMESTAMP or CurrentTime
Error: Atom, Window

Changes the owner and last-change time of the specifed selection. The request has no effect if the specified time is earlier than the current last-change time of the specified selection or is later than the current server time; otherwise, the last-change time is set to the specified time, with CurrentTime replaced by the current server time. If the new owner is not the same as the current owner of the selection, and the current owner is a window, then the current owner is sent a SelectClear event.

If the owner of a selection is a window, and the window is later destroyed, the owner of the selection automatically reverts to None, but the last-change time is not affected.

The selection atom is uninterpreted by the server.

Selections are global to the server.

GetSelectionOwner​

selection: ATOM

=>

owner: WINDOW or None
Errors: Atom

Returns the current owner of the specified selection, if any.

ConvertSelection​

selection, target: ATOM
property: ATOM or None
requestor: WINDOW
time: TIMESTAMP or CurrentTime
Error: Atom, Window

If the specified selection is owned by a window, the server sends a SelectionRequest event to the owner. If no owner for the specified selection exists, the server generates a SelectionNotify event to the requestor with property None. The arguments are passed on unchanged in either event.

SendEvent​

destination: WINDOW or PointerWindow or InputFocus
propagate: BOOL
event-mask: SETofEVENT
event: <normal-event-format>
Errors: Window, Value

If PointerWindow is specified, destination is replaced with the window that the pointer is in. If InputFocus is specified, then if the focus window contains the pointer, destination is replaced with the window that the pointer is in, and otherwise destination is replaced with the focus window.

If propagate is False, then the event is sent to every client selecting on destination any of the event types in event-mask.

If propagate is True and no clients have selected on destination any of the event types in event-mask, then destination is replaced with the closest ancestor of destination for which some client has selected a type in event-mask and no intervening window has that type in its do-not-propagate-mask. If no such window exists, or if the window is an ancestor of the focus window and InputFocus was originally specified sent to any clients. Otherwise, the event is reported to every client selecting on the final destination any of the types specified in event-mask.

The event code must be one of the core events, or one of the events defined by an extension, so that the server can correctly byte swap the contents as necessary. The contents of the event are otherwise unaltered and unchecked by the server except to force on the most significant bit of the event code.

Active grabs are ignored for this request.