Events
When a button is pressed with the pointer in some window W, and no active pointer grab is in progress, then the ancestors if W are searched from the root down, looking for a passive grab to activate. If no matching passive grab on the button exists, then an active grab is started automatically for the client receiving the event, and the last-pointer-grab time is set to the current server time. The effect is essentially equivalent to a GrabButton with arguments:
event-window: the event window
event-mask: the client's selected events on the event window
pointer-mode and keyboard-mode: Asynchronous
owner-events: True if the client has OwnerGrabButton selected
on the event window, else False
confine-to: None
cursor: None
The grab is terminated automatically when all buttons are released. UngrabPointer and ChangeActiveGrab can both be used to modify the active grab.
KeyPress
and
KeyRelease
and
ButtonPress
and
ButtonRelease
and
MotionNotify
root, event: WINDOW
child: WINDOW or None
same-screen: BOOL
root-x, root-y, event-x, event-y: INT16
detail: <see below>
state: SETofKEYBUTMASK
time: TIMESTAMP
Generated when a key or button changes state, or the pointer moves. The "source" of the event is the window the pointer is in. The window with respect to which the event is normally reported is found by looking up the hierarchy (starting with the source window) for the first window on which any client has selected interest in the event, provided no intervening window prohibits event generation by including the event type in its do-not-propagate-mask. The actual window used for reporting can be modified by active grabs and the focus window. The window the event is reported with respect to is called the "event" window.
Root is the root window of the "source" window, and root-x and root-y are the pointer coordinates relative to root's origin at the time of the event. Event is the "event" window. If the event window is on the same screen as root, then event-x and event-y are the pointer coordinates relative to the event window's origin; otherwise event-x and event-y are zero. If the source window is an inferior of the event window, then child is set to the child of the event window that is an ancestor of the source window. The state component gives the state of the buttons and modifier keys just before the event. The detailcomponent varies with the event type:
KeyPress, KeyRelease: KEYCODE
ButtonPress, ButtonRelease: BUTTON
MotionNotify: {Normal, Hint}
MotionNotify events are only generated when the motion begins and ends in the window. The granularity of motion events is not guaranteed, but a client selecting for motion events is guaranteed to get at least one event when the pointer moves and comes to rest. Selecting PointerMotion receives events independent of the state of the pointer buttons. By selecting some subset of Button[1-5]Motion instead, MotionNotify events will only be received when one or more of the specified buttons are pressed. By selecting ButtonMotion, MotionNotify events will received only when at least one button is pressed. The events are always of type MotionNotify, independent of the selection. If PointerMotionHint is selected, the server is free to send only one MotionNotify event (with detail Hint) to the client for the event window, until either the key or button state changes, or the pointer leaves the event window, or the client issues a QueryPointer or GetMotionEvents request.
EnterNotify
and
LeaveNotify
root, event: WINDOW
child: WINDOW or None
same-screen: BOOL
root-x, root-y, event-x, event-y: INT16
mode: {Normal, Grab, Ungrab}
detail: {Ancestor, Virtual, Inferior, Nonlinear,
NonlinearVirtual}
focus: BOOL
state: SETofKEYBUTMASK
time: TIMESTAMP
If pointer motion causes the pointer to be in a different window than before, EnterNotify and LeaveNotify events are generated instead of a MotionNotify event. Only clients selecting EnterWindow on a window receive EnterNotify events, and only clients selection LeaveNotifyreceive LeaveNotify events. The pointer position reported in the event is always the "final" position, not the "initial" position of the pointer. In a LeaveNotify event, if a child of the event window contains the "initial" position of the pointer, then the child component is set to that child, otherwise it is None. For an EnterNotify event, if a child of the event window contains the "final" pointer position, then the child component is set to that child, otherwise it is None. If the the event window is the focus window or an inferior of the focus window, then focus is True, and otherwisefocus is False.
Normal pointer motion events have mode Normal; pseudo-motion events when a grab actives have mode Grab, and pseudo-motion events when a grab deactivates have mode Ungrab.
Normal events are generated as follows
When the pointer moves from window A to window B, and A is an inferior of B:
LeaveNotify with detail Ancestor is generated on A
LeaveNotify with detail Virtual is generated on each window
between A and B exclusive (in that order)
EnterNotify with detail Inferior is generated on B
When the pointer moves from window A to window B, and B is an inferior of A:
LeaveNotify with detail Inferior is generated on A
EnterNotify with detail Virtual is generated on each window
between A and B exclusive (in that order)
EnterNotify with detail Ancestor is generated on B
When the pointer moves from window A to window B, with window C being their least common ancestor:
LeaveNotify with detail Nonlinear is generated on A
LeaveNotify with detail NonlinearVirtual is generated on each
window between A and C exclusive (in that order)
EnterNotify with detail NonlinearVirtual is generated on each
window between C and B exclusive (in that order)
EnterNotify with detail Nonlinear is generated on B
When the pointer moves from window A to window B, on different screens:
LeaveNotify with detail Nonlinear is generated on A
LeaveNotify with detail NonlinearVirtual is generated on each
window above A up to and including its root (in
order)
EnterNotify with detail NonlinearVirtual is generated on each
window
from B's root down to but not including B (in order)
EnterNotify with detail Nonlinear is generated on B
When a pointer grab activates (but after any initial warp into a confine-to window), with G the grab-window for the grab and P the window the pointer is in:
EnterNotify and LeaveNotify events with mode Grab are
generated (as for Normal above) as if the pointer were to
suddenly warp from its current position in P to some position
in G.However, the pointer does not warp, and the pointer
position is used as both the "initial"and "final" positions
for the events.
When a pointer grab deactivates, with G the grab-window for the grab and P the window the pointer is in:
EnterNotify and LeaveNotify events with mode Ungrab are generated (as for Normal above) as if the pointer were to suddenly warp from from some position in G to its current position in P. However, the pointer does not warp, and the current pointer position is used as both the "initial" and "final" positions for the events.
FocusIn
and
FocusOut
event: WINDOW
mode: {Normal, WhileGrabbed, Grab, Ungrab}
detail: {Ancestor, Virtual, Inferior, Nonlinear,
NonlinearVirtual, Pointer, PointerRoot, None}
Generated when the input focus changes. Reported to clients selecting FocusChange on the window. Events generated by SetInputFocus when the keyboard is not grabbed have mode Normal; events generated by SetInputFocus when the keyboard is grabbed have mode WhileGrabbed; events generated when a keyboard grab actives have mode Grab, and events generated when a keyboard grab deactivates have mode Ungrab.
Normal and WhileGrabbed events are generated as follows
When the focus moves from window A to window B, and A is an inferior of B, with the pointer in window P:
FocusOut with detail Ancestor is generated on A
FocusOut with detail Virtual is generated on each window
between A and B exclusive (in that order)
FocusIn with detail Inferior is generated on B
If P is an inferior of B, but P is not A or an inferior of A
or an ancestor of A, FocusIn with detail Pointer is
generated on each window below B down to and
including P (in order)
When the focus moves from window A to window B, and B is an inferior of A, with the pointer in window P:
If P is an inferior of A, but P is not A or an inferior of B
or an ancestor of B, FocusOut with detail Pointer is
generated on each window from P up to but not
including A (in order)
FocusOut with detail Inferior is generated on A
FocusIn with detail Virtual is generated on each window
between A and B exclusive (in that order)
FocusIn with detail Ancestor is generated on B
When the focus moves from window A to window B, with window C being their least common ancestor, and with the pointer in window P:
If P is an inferior of A, FocusOut with detail Pointer is
generated on each window from P up to but not
including A (in order)
FocusOut with detail Nonlinear is generated on A
FocusOut with detail NonlinearVirtual is generated on each
window between A and C exclusive (in that order)
FocusIn with detail NonlinearVirtual is generated on each
window between C and B exclusive (in that order)
FocusIn with detail Nonlinear is generated on B
If P is an inferior of B, FocusIn with detail Pointer is
generated on each window below B down to and
including P (in order)
When the focus moves from window A to window B, on different screens, with the pointer in window P:
If P is an inferior of A, FocusOut with detail Pointer is
generated on each window from P up to but not
including A (in order)
FocusOut with detail Nonlinear is generated on A
FocusOut with detail NonlinearVirtual is generated on each
window above A up to and including its root (in
order)
FocusIn with detail NonlinearVirtual is generated on each
window from B's root down to but not including B
(in order)
FocusIn with detail Nonlinear is generated on B
If P is an inferior of B, FocusIn with detail Pointer is
generated on each window below B down to and
including P (in order)
When the focus moves from window A to PointerRoot (or None)
If P is an inferior of A, FocusOut with detail Pointer is
generated on each window from P up to but not
including A (in order)
FocusOut with detail Nonlinear is generated on A
FocusOut with detail NonlinearVirtual is generated on each
window above A up to and including its root (in
order)
FocusIn with detail PointerRoot (or None) is generated on
all root windows
When the focus moves from PointerRoot (or None) to window A
FocusOut with detail PointerRoot (or None) is generated on
all root windows
FocusIn with detail NonlinearVirtual is generated on each
window from A's root down to but not including A
(in order)
FocusIn with detail Nonlinear is generated on A If P is an inferior of A, FocusIn with detail Pointer is
generated on each window below A down to and
including P (in order)
When the focus moves from PointerRoot to None (or vice versa)
FocusOut with detail PointerRoot (or None) is generated on
all root windows
FocusIn with detail None (or PointerRoot) is generated on
all root windows
When a keyboard grab activates, with G the grab-window for the grab and F the current focus:
FocusIn and FocusOut events with mode Grab are generated (as
for Normal above) as if the focus were to change from F to G
When a keyboard grab deactivates, with G the grab-window for the grab and F the current focus:
FocusIn and FocusOut events with mode Ungrab are generated
(as for Normal above) as if the focus were to change from G
to F
KeymapNotify
keys: LISTofCARD8
The value is a bit vector, as described in QueryKeymap. Reported to clients selecting KeymapState on a window. Generated immediately after every EnterNotify and FocusIn.
Expose
window: WINDOW
x, y, width, height: CARD16
last-in-series: BOOL
Reported to clients selecting Exposure on the window. Possibly generated when a region of the window becomes viewable, but might only be generated when a region becomes visible. All of the regions exposed by a given "action" are guaranteed to be reported contiguously; if last-in-series is False then another exposure follows.
The x and y coordinates are relative to drawable's origin, and specify the upper left corner of a rectangule. The width and height specify the extent of the rectangle.
Expose events are never generated on InputOnly windows.
GraphicsExposure
drawable: DRAWABLE
x, y, width, height: CARD16
last-in-series: BOOL
major-opcode: CARD8
minor-opcode: CARD16
Reported to clients selecting graphics-exposures in a graphics context. Generated when a destination region could not be computed due to an obscured or out-of-bounds source region. All of the regions exposed by a given graphics request are guaranteed to be reported contiguously; if last-in-series is False then another exposure follows.
The x and y coordinates are relative to drawable's origin, and specify the upper left corner of a rectangule. The width and height specify the extent of the rectangle.
The major and minor opcodes identify the graphics request used. For the core protocol, major-opcode is always CopyArea or CopyPlane and minor-opcode is always zero.
NoExposure
drawable: DRAWABLE
major-opcode: CARD8
minor-opcode: CARD16
Reported to clients selecting graphics-exposures in a graphics context. Generated when a graphics request that might produce GraphicsExposure events does not produce any. The drawable specifies the destination used for the graphics request.
The major and minor opcodes identify the graphics request used. For the core protocol, major-opcode is always CopyArea or CopyPlane and minor-opcode is always zero.
VisibilityNotify
window: WINDOW
state: {Unobscured, PartiallyObscured, FullyObscured}
Reported to clients selecting VisibilityChange on the window. In the following, the state of the window is calculated ignoring all of the window's subwindows. When a window changes state from partially or fully obscured or not viewable to viewable and completely unobscured, an event with Unobscured is generated. When a window changes state from a) viewable and completely unobscured or b) not viewable, to viewable and partially obscured, an event with PartiallyObscured is generated. When a window changes state from a) viewable and completely unobscured or b) viewable and partially obscured or c) not viewable, to viewable and fully obscured, an event with FullyObscured is generated.
VisibilityNotify events are never generated on InputOnly windows.
CreateNotify
parent, window: WINDOW
x, y: INT16
width, height, border-width: CARD16
override-redirect: BOOL
Reported to clients selecting SubstructureNotify on the parent. Generated when the window is created. The arguments are as in the CreateWindow request.
DestroyNotify
event, window: WINDOW
Reported to clients selecting StructureNotify on the window, and to clients selecting SubstructureNotify on the parent. Generated when the window is destroyed. "Event" is the window on which the event was generated, and "window" is the window that is destroyed.
UnmapNotify
event, window: WINDOW
from-configure: BOOL
Reported to clients selecting StructureNotify on the window, and to clients selecting SubstructureNotify on the parent. Generated when the window changes state from mapped to unmapped. "Event" is the window on which the event was generated, and "window" is the window that is unmapped. The from-configure flag is True if the event was generated as a result of the window's parent being resized when the window itself had a win-gravity of Unmap.
MapNotify
event, window: WINDOW
override-redirect: BOOL
Reported to clients selecting StructureNotify on the window, and to clients selecting SubstructureNotify on the parent. Generated when the window changes state from unmapped to mapped. "Event" is the window on which the event was generated, and "window" is the window that is mapped. The override-redirect flag is from the window's attribute.
MapRequest
parent, window: WINDOW
Reported to the client selecting SubstructureRedirect on the parent. Generated when a MapWindow request is issued on an unmapped window with an override-redirect attribute of False.
ReparentNotify
event, window, parent: WINDOW
x, y: INT16
override-redirect: BOOL
Reported to clients selecting SubstructureNotify on either the old or the new parent, and to clients selecting StructureNotify on the window. Generated when the window is reparented. "Event" is the window on which the event was generated, "window" is the window that has been re-rooted, and "parent" specifies the new parent. The x and y coordinates are relative to the new parent's origin, and specify the position of the upper left outer corner of the window. The override-redirect flag is from the window's attribute.
ConfigureNotify
event, window: WINDOW
x, y: INT16
width, height, border-width: CARD16
above-sibling: WINDOW or None
override-redirect: BOOL
Reported to clients selecting StructureNotify on the window, and to clients selecting SubstructureNotify on the parent. Generated when a ConfigureWindow request actually changes the state of the window. "Event" is the window on which the event was generated, and "window" is the window that is changed. If above-sibling is None, then the window is on the bottom of the stack with respect to siblings; otherwise, the window is immediately on top of the specified sibling. The override-redirect flag is from the window's attribute.
GravityNotify
event, window: WINDOW
x, y: INT16
Reported to clients selecting SubstructureNotify on the parent, and to clients selecting StructureNotify on the window. Generated when a window is moved because of a change in size of the parent. "Event" is the window on which the event was generated, and "window" is the window that is moved.
ResizeRequest
window: WINDOW
width, height: CARD16
Reported to the client selecting ResizeRedirect on the window. Generated when a ConfigureWindow request by some other client on the window attempts to change the size of the window. The width and height are the inside size, not including the border.
ConfigureRequest
parent, window: WINDOW
x, y: INT16
width, height, border-width: CARD16
above-sibling: WINDOW or None
Reported to the client selecting SubstructureRedirect on the parent. Generated when a ConfigureWindow request is issued on the window by some other client. The geometry is as derived from the request. The above-sibling is the sibling the window should be placed directly on top of; if None, then the window should be placed on the bottom.
CirculateNotify
event, window: WINDOW
place: {Top, Bottom}
Reported to clients selecting StructureNotify on the window, and to clients selecting SubstructureNotify on the parent. Generated when the window is actually restacked from a CirculateWindow request. "Event" is the window on which the event was generated, and "window" is the window that is restacked. If place is Top, the window is now on top of all siblings; otherwise it is below all siblings.
CirculateRequest
parent, window: WINDOW
place: {Top, Bottom}
Reported to the client selecting SubstructureRedirect on the parent. Generated when a CirculateWindow request is issued on the parent and a window actually needs to be restacked. The window specifies the window to be restacked, and place specifies what the new position in the stacking order should be.
PropertyNotify
window: WINDOW
atom: ATOM
state: {NewValue, Deleted}
time: TIMESTAMP
Reported to clients selecting PropertyChange on the window. Generated when a property of the window is changed. The timestamp indicates the server time when the property was changed.
SelectionClear
owner: WINDOW
selection: ATOM
time: TIMESTAMP
Reported to the current owner of a selection. Generated on the window losing ownership when a new owner is being defined. The timestamp is the last-change time recorded for the selection.
SelectionRequest
owner: WINDOW
selection: ATOM
target: ATOM
property: ATOM or None
requestor: WINDOW
time: TIMESTAMP or CurrentTime
Reported to the owner of a selection. Generated when a client issues a ConvertSelection request. The arguments are as in the request.
The owner should convert the selection based on the specified target type. If a property is specified, the owner should store the result as that property on the requestor window, and then send a SelectionNotify event to the requestor using SendEvent. If the selection cannot be converted as requested, the owner should send a SelectionNotify with the property set to None.
SelectionNotify
requestor: WINDOW
selection, target: ATOM
property: ATOM or None
time: TIMESTAMP or CurrentTime
This event is only generated by clients using SendEvent. The owner of a selection should send this event to a requestor when a selection has been converted and stored as a property, or when a selection conversion could not be performed (indicated with property None).
ColormapNotify
window: WINDOW
colormap: COLORMAP or None
new: BOOL
state: {Installed, Uninstalled}
Reported to clients selecting ColormapChange on the window. Generated with value True for new when the colormap attribute of the window is changed. Generated with value False for new when the colormap of a window is installed or uninstalled. In either case, state indicates whether the colormap is currently installed.
ClientMessage
window: WINDOW
type: ATOM
format: {8, 16, 32}
data: LISTofINT8 or LISTofINT16 or LISTofINT32
This event is only generated by clients using SendEvent. The type specifies how the data is to be interpreted by the receiving client; the server places no interpretation on the type or the data. The format specifies whether the data should be viewed as a list of 8-bit, 16-bit, or 32-bit quantities, so that the server can correctly byte-swap as necessary. The data always consists of either 20 8-bit values or 10 16-bit values or 5 32-bit values, although particular message types might not make use of all of these values.