Xlib Programming Manual (O'Reilly & Associates, Inc.) |
This appendix describes each event structure in detail
and briefly shows how each event type is used. It covers the most common
uses of each event type, the information contained in each event structure,
how the event is selected, and the side effects of the event, if any. Each
event is described on a separate reference page.
XEvent union and XAnyEvent structure
typedef union _XEvent {
int type; /* Must not be changed; first member */
XAnyEvent xany;
XButtonEvent xbutton;
XCirculateEvent xcirculate;
XCirculateRequestEvent xcirculaterequest;
XClientMessageEvent xclient;
XColormapEvent xcolormap;
XConfigureEvent xconfigure;
XConfigureRequestEvent xconfigurerequest;
XCreateWindowEvent xcreatewindow;
XDestroyWindowEvent xdestroywindow;
XCrossingEvent xcrossing;
XExposeEvent xexpose;
XFocusChangeEvent xfocus;
XNoExposeEvent xnoexpose;
XGraphicsExposeEvent xgraphicsexpose;
XGravityEvent xgravity;
XKeymapEvent xkeymap;
XKeyEvent xkey;
XMapEvent xmap;
XUnmapEvent xunmap;
XMappingEvent xmapping;
XMapRequestEvent xmaprequest;
XMotionEvent xmotion;
XPropertyEvent xproperty;
XReparentEvent xreparent;
XResizeRequestEvent xresizerequest;
XSelectionClearEvent xselectionclear;
XSelectionEvent xselection;
XSelectionRequestEvent xselectionrequest;
XVisibilityEvent xvisibility;
} XEvent;
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 window; /* window on which event was requested
* in event mask */
} XAnyEvent;
The first member of the XEvent union is the type of
event. When an event is received (with XNextEvent, for example),
the application checks the type member in the XEvent union.
Then the specific event type is known and the specific event structure
(such as xbutton) is used to access information specific to that
event type.
Before the branching depending on the event type, only the XEvent union is used. After the branching, only the event structure which contains the specific information for each event type should be used in each branch. For example, if the XEvent union were called report, the report.xexpose structure should be used within the branch for Expose events.
You will notice that each event structure also begins with a type member. This member is rarely used, since it is an identical copy of the type member in the XEvent union.
Most event structures also have a window member. The only ones that do not are certain selection events (SelectionNotify and SelectionRequest) and events selected by the graphics_exposures member of the GC (GraphicsExpose and NoExpose). The window member indicates the event window that selected and received the event. This is the window where the event arrives if it has propagated through the hierarchy as described in Section 8.3.2, "Propagation of Device Events", of Volume One, Xlib Programming Manual. One event type may have two different meanings to an application, depending on which window it appears in.
Many of the event structures also have a display and/or root member. The display member identifies the connection to the server that is active. The root member indicates which screen the window that received the event is linked to in the hierarchy. Most programs only use a single screen and therefore do not need to worry about the root member. The display member can be useful, since you can pass the display variable into routines by simply passing a pointer to the event structure, eliminating the need for a separate display argument.
All event structures include a serial member that gives the number of the last protocol request processed by the server. This is useful in debugging, since an error can be detected by the server but not reported to the user (or programmer) until the next routine that gets an event. That means several routines may execute successfully after the error occurs. The last request processed will often indicate the request that contained the error.
All event structures also include a send_event flag, which, if True, indicates that the event was sent by XSendEvent (i.e., by another client rather than by the server).
The following pages describe each event type in detail.
The events are presented in alphabetical order, each on a separate page.
Each page describes the circumstances under which the event is generated,
the mask used to select it, the structure itself, its members, and useful
programming notes. Note that the description of the structure members does
not include those members common to many structures. If you need more information
on these members, please refer to this introductory section.
(generated event).
typedef union _XEvent {
...
XButtonEvent xbutton;
...
} XEvent;
typedef struct {
int type; /* of event */
unsigned long serial; /* # of last request processed by server */
Bool send_event; /* True if this came from a SendEvent request */
Display *display; /* Display the event was read from */
Window window; /* event window it is reported relative to */
Window root; /* root window that the event occurred under */
Window subwindow; /* child window */
Time time; /* when event occurred, in milliseconds */
int x, y; /* pointer coordinates relative to receiving * window */
int x_root, y_root; /* coordinates relative to root */
unsigned int state; /* mask of all buttons and modifier keys */
unsigned int button; /* button that triggered event */
Bool same_screen; /* same screen flag */
} XButtonEvent;
typedef XButtonEvent XButtonPressedEvent;
typedef XButtonEvent XButtonReleasedEvent;
If the application has invoked a passive button grab on
an ancestor of the window in which the ButtonPress event occurs,
then that grab takes precedence over the automatic grab, and the ButtonRelease
will go to that window, or it will be handled normally by that client depending
on the owner_events flag in the XGrabButton call.
(generated event).
typedef union _XEvent {
...
XCirculateEvent xcirculate;
...
} XEvent;
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 event;
Window window;
int place; /* PlaceOnTop, PlaceOnBottom */
} XCirculateEvent;
This event differs from CirculateNotify in that it delivers the parameters of the request before it is carried out. This gives the client that selects this event (usually the window manager) the opportunity to review the request in the light of its window management policy before executing the circulate request itself or to deny the request. (CirculateNotify indicates the final outcome of the request.)
typedef union _XEvent {
...
XCirculateRequestEvent xcirculaterequest;
...
} XEvent;
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 parent;
Window window;
int place; /* PlaceOnTop, PlaceOnBottom */
} XCirculateRequestEvent;
typedef union _XEvent {
...
XClientMessageEvent xclient;
...
} XEvent;
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 window;
Atom message_type;
int format;
union {
char b[20];
short s[10];
long l[5];
} data;
} XClientMessageEvent;
typedef union _XEvent {
...
XColormapEvent xcolormap;
...
} XEvent;
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 window;
Colormap colormap; /* a colormap or None */
Bool new;
int state; /* ColormapInstalled, ColormapUninstalled */
} XColormapEvent;
typedef union _XEvent {
...
XConfigureEvent xconfigure;
...
} XEvent;
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 event;
Window window;
int x, y;
int width, height;
int border_width;
Window above;
Bool override_redirect;
} XConfigureEvent;
This event differs from ConfigureNotify in that it delivers the parameters of the request before it is carried out. This gives the client that selects this event (usually the window manager) the opportunity to revise the requested configuration before executing the XConfigureWindow() request itself or to deny the request. (ConfigureNotify indicates the final outcome of the request.)
typedef union _XEvent {
...
XConfigureRequestEvent xconfigurerequest;
...
} XEvent;
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 parent;
Window window;
int x, y;
int width, height;
int border_width;
Window above;
int detail; /* Above, Below, BottomIf, TopIf, Opposite */
unsigned long value_mask;
} XConfigureRequestEvent;
typedef union _XEvent {
...
XCreateWindowEvent xcreatewindow;
...
} XEvent;
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 parent; /* parent of the window */
Window window; /* window ID of window created */
int x, y; /* window location */
int width, height; /* size of window */
int border_width; /* border width */
Bool override_redirect; /* creation should be overridden */
} XCreateWindowEvent;
typedef union _XEvent {
...
XDestroyWindowEvent xdestroywindow;
...
} XEvent;
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 event;
Window window;
} XDestroyWindowEvent;
When the pointer crosses a window border, a LeaveNotify event occurs in the window being left and an EnterNotify event occurs in the window being entered. Whether or not each event is queued for any application depends on whether any application selected the right event on the window in which it occurred.
In addition, EnterNotify and LeaveNotify events are delivered to windows that are virtually crossed. These are windows that are between the origin and destination windows in the hierarchy but not necessarily on the screen. Further explanation of virtual crossing is provided two pages following.
typedef union _XEvent {
...
XCrossingEvent xcrossing;
...
} XEvent;
typedef struct {
int type; /* of event */
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 window; /* event window it is reported relative to */
Window root; /* root window that the event occurred on */
Window subwindow; /* child window */
Time time; /* milliseconds */
int x, y; /* pointer x,y coordinates in receiving
* window */
int x_root, y_root; /* coordinates relative to root */
int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */
int detail; /* NotifyAncestor, NotifyInferior,
* NotifyNonLinear, NotifyNonLinearVirtual,
* NotifyVirtual */
Bool same_screen; /* same screen flag */
Bool focus; /* boolean focus */
unsigned int state; /* key or button mask */
} XCrossingEvent;
typedef XCrossingEvent XEnterWindowEvent;
typedef XCrossingEvent XLeaveWindowEvent;
Virtual crossing is an advanced topic that you should not spend time figuring out unless you have an important reason to use it. We have never seen an application that uses this feature, and we know of no reason for its extreme complexity. With that word of warning, proceed.
Let's say the pointer has moved from one window, the origin, to another, the destination. First, we'll specify what types of events each window gets and then the detail member of each of those events.
The window of origin receives a LeaveNotify event and the destination window receives an EnterNotify event, if they have requested this type of event. If one is an inferior of the other, the detail member of the event received by the inferior is NotifyAncestor and the detail of the event received by the superior is NotifyInferior. If the crossing is between parent and child, these are the only events generated.
However, if the origin and destination windows are not parent and child, other windows are virtually crossed and also receive events. If neither window is an ancestor of the other, ancestors of each window, up to but not including the least common ancestor, receive LeaveNotify events, if they are in the same branch of the hierarchy as the origin, and EnterNotify events, if they are in the same branch as the destination. These events can be used to track the motion of the pointer through the hierarchy.
| LeaveNotify | EnterNotify |
|---|---|
| Origin window (A) | Destination window (B) |
| Windows between A and B, exclusive, if A is inferior | Windows between A and B, exclusive, if B is inferior |
| Windows between A and C, exclusive | Windows between B and C, exclusive |
| Root window on screen of origin if different from screen of destination | Root window on screen of destination if different from screen of origin |
Table E-2 lists the detail members in events generated
by a pointer crossing from window A to window B.
| detail Flag | Window Delivered To |
|---|---|
| NotifyAncestor | Origin or destination when either is descendant |
| NotifyInferior | Origin or destination when either is ancestor |
| NotifyVirtual | Windows between A and B, exclusive, if either is descendant |
| NotifyNonlinear | Origin and destination when A and B are two or more windows distant from least common ancestor C |
| NotifyNonlinearVirtual ancestor C; also on both root windows if A and B are on different screens | Windows between A and C, exclusive, and between B and C, exclusive, when A and B have least common |
For example, Figure E-1 shows the events that are generated by a movement from a window (window A) to a child (window B1) of a sibling (window B). This would generate three events: a LeaveNotify with detail NotifyNonlinear for the window A, an EnterNotify with detail NotifyNonlinearVirtual for its sibling window B, and an EnterNotify with detail NotifyNonlinear for the child (window B1).
Events generated by a move between windows
EnterNotify and LeaveNotify events are also generated when the pointer is grabbed, if the pointer was not already inside the grabbing window. In this case, the grabbing window receives an EnterNotify and the window containing the pointer receives a LeaveNotify event, both with modeNotifyUngrab. The pointer position in both events is the position before the grab. The result when the grab is released is exactly the same, except that the two windows receive EnterNotify instead of LeaveNotify and vice versa.
Figure E-2 demonstrates the events and details caused by various pointer transitions, indicated by heavy arrows.
Border crossing events and detail member for pointer movement from window A to window B, for various window relationships
(generated
event).
typedef union _XEvent {
...
XExposeEvent xexpose;
...
} XEvent;
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 window;
int x, y;
int width, height;
int count; /* If nonzero, at least this many more */
} XExposeEvent;
If your application is able to redraw partial windows,
you can also read each exposure event in turn and redraw each area.
(generated event).
When a focus change occurs, a FocusOut event is delivered to the old focus window and a FocusIn event to the window which receives the focus. In addition, windows in between these two windows in the window hierarchy are virtually crossed and receive focus change events, as described below. Some or all of the windows between the window containing the pointer at the time of the focus change and the root window also receive focus change events, as described below.
typedef union _XEvent {
...
XFocusChangeEvent xfocus;
...
} XEvent;
typedef struct {
int type; /* FocusIn or FocusOut */
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 window; /* Window of event */
int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */
int detail; /* NotifyAncestor, NotifyDetailNone,
* NotifyInferior, NotifyNonLinear,
* NotifyNonLinearVirtual, NotifyPointer,
* NotifyPointerRoot, NotifyVirtual */
} XFocusChangeEvent;
typedef XFocusChangeEvent XFocusInEvent;
typedef XFocusChangeEvent XFocusOutEvent;
Most window managers allow the user to set a focus window to avoid the problem where the pointer sometimes gets bumped into the wrong window and your typing does not go to the intended window. If the pointer is pointing at the root window, all typing is usually lost, since there is no application for this input to propagate to. Some applications may set the keyboard focus so that they can get all keyboard input for a given period of time, but this practice is not encouraged.
Focus events are used when an application wants to act differently when the keyboard focus is set to another window or to itself. FocusChangeMask is used to select FocusIn and FocusOut events.
When a focus change occurs, a FocusOut event is delivered to the old focus window and a FocusIn event is delivered to the window which receives the focus. Windows in between in the hierarchy are virtually crossed and receive one focus change event each depending on the relationship and direction of transfer between the origin and destination windows. Some or all of the windows between the window containing the pointer at the time of the focus change and that window's root window can also receive focus change events. By checking the detail member of FocusIn and FocusOut events, an application can tell which of its windows can receive input.
The detail member gives clues about the relationship of the event receiving window to the origin and destination of the focus. The detail member of FocusIn and FocusOut events is analogous to the detail member of EnterNotify and LeaveNotify events but with even more permutations to make life complicated.
E-3 shows the event types generated by a focus transition
from window A to window B when window C is the least
common ancestor of A and B. This table includes most of the
events generated, but not all of them. It is quite possible for a single
window to receive more than one focus change event from a single focus
change.
| FocusOut | FocusIn |
|---|---|
| Origin window (A) | Destination window (B) |
| Windows between A and B, exclusive, if A is inferior | Windows between A and B, exclusive, if B is inferior |
| Windows between A and C, exclusive | Windows between B and C, exclusive |
| Root window on screen of origin if different from screen of destination | Root window on screen of destination if different from screen of origin |
| Pointer window up to but not including origin window if pointer window is descendant of origin | Pointer window up to but not including destination window if pointer window is descendant of destination |
| Pointer window up to and including pointer window's root if transfer was from PointerRoot | Pointer window up to and including pointer window's root if transfer was to PointerRoot |
E-4 lists the detail members in events generated by a focus transition from window A to window B when window C is the least common ancestor of A and B, with P being the window containing the pointer.
| detail Flag | Window Delivered To |
|---|---|
| NotifyAncestor | Origin or destination when either is descendant |
| NotifyInferior | Origin or destination when either is ancestor |
| NotifyVirtual | Windows between A and B, exclusive, if either is descendant |
| NotifyNonlinear | Origin and destination when A and B are two or more windows distant from least common ancestor C |
| NotifyNonlinearVirtual | Windows between A and C, exclusive, and between B and C, exclusive, when A and B have least common ancestor C; also on both root windows if A and B are on different screens |
| NotifyPointer | Window P and windows up to but not including the origin or destination windows |
| NotifyPointerRoot | Window P and all windows up to its root, and all other roots, when focus is set to or from PointerRoot |
| NotifyDetailNone | All roots, when focus is set to or from None |
E-3 shows all the possible combinations of focus transitions and of origin, destination, and pointer windows and shows the types of events that are generated and their detail member. Solid lines indicate branches of the hierarchy. Dotted arrows indicate the direction of transition of the focus. At each end of this arrow are the origin and destination windows, windows A to B. Arrows ending in a bar indicate that the event type and detail described are delivered to all windows up to the bar.
In any branch, there may be windows that are not shown. Windows in a single branch between two boxes shown will get the event types and details shown beside the branch.
FocusIn and FocusOut event schematics
FocusIn and FocusOut event schematics (cont'd)
FocusIn and FocusOut events are also
generated when the keyboard is grabbed, if the focus was not already assigned
to the grabbing window. In this case, all windows receive events as if
the focus was set from the current focus to the grab window. When the grab
is released, the events generated are just as if the focus was set back.
(generated event).
typedef union _XEvent {
...
XNoExposeEvent xnoexpose;
XGraphicsExposeEvent xgraphicsexpose;
...
} XEvent;
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 */
Drawable drawable;
int x, y;
int width, height;
int count; /* if nonzero, at least this many more */
int major_code; /* core is X_CopyArea or X_CopyPlane */
int minor_code; /* not defined in the core */
} XGraphicsExposeEvent;
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 */
Drawable drawable;
int major_code; /* core is X_CopyArea or X_CopyPlane */
int minor_code; /* not defined in the core */
} XNoExposeEvent;
typedef union _XEvent {
...
XGravityEvent xgravity;
...
} XEvent;
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 event;
Window window;
int x, y;
} XGravityEvent;
typedef union _XEvent {
...
XKeyEvent xkey;
...
} XEvent;
typedef struct {
int type; /* of event */
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 window; /* event window it is reported relative to */
Window root; /* root window that the event occurred on */
Window subwindow; /* child window */
Time time; /* milliseconds */
int x, y; /* pointer coordinates relative to receiving
* window */
int x_root, y_root; /* coordinates relative to root */
unsigned int state; /* modifier key and button mask */
unsigned int keycode; /* server-dependent code for key */
Bool same_screen; /* same screen flag */
} XKeyEvent;
typedef XKeyEvent XKeyPressedEvent;
typedef XKeyEvent XKeyReleasedEvent;
Keyboard events are analogous to button events, though, of course, there are many more keys than buttons and the keyboard is not automatically grabbed between press and release.
All the structure members have the same meaning as described
for ButtonPress and ButtonRelease events, except that button
is replaced by keycode.
(generated event).
typedef union _XEvent {
...
XKeymapEvent xkeymap;
...
} XEvent;
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 window;
char key_vector[32];
} XKeymapEvent;
typedef union _XEvent {
...
XMapEvent xmap;
XUnmapEvent xunmap;
...
} XEvent;
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 event;
Window window;
Bool override_redirect; /* boolean, is override set */
} XMapEvent;
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 event;
Window window;
Bool from_configure;
} XUnmapEvent;
This event differs from MapNotify in that it delivers the parameters of the request before it is carried out. This gives the client that selects this event (usually the window manager) the opportunity to revise the size or position of the window before executing the map request itself or to deny the request. (MapNotify indicates the final outcome of the request.)
typedef union _XEvent {
...
XMapRequestEvent xmaprequest;
...
} XEvent;
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 parent;
Window window;
} XMapRequestEvent;
This event type should not be confused with the event that occurs when a window is mapped; that is a MapNotify event. Nor should it be confused with the KeymapNotify event, which reports the state of the keyboard as a mask instead of as a keycode.
typedef union _XEvent {
...
XMappingEvent xmapping;
...
} XEvent;
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 window; /* unused */
int request; /* one of MappingMapping, MappingKeyboard,
* MappingPointer */
int first_keycode; /* first keycode */
int count; /* range of change with first_keycode*/
} XMappingEvent;
The normal response to a request member of MappingPointer
or MappingModifier is no action. This is because the clients should
use the logical mapping of the buttons and modifiers to allow the user
to customize the keyboard if desired. If the application requires a particular
mapping regardless of the user's preferences, it should call XGetModifierMapping
or XGetPointerMapping to find out about the new mapping.
(generated event).
See 8.3.3.3 of Volume One, Xlib Programming Manual, for a description of selecting button events.
typedef union _XEvent {
...
XMotionEvent xmotion;
...
} XEvent;
typedef struct {
int type; /* of event */
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 window; /* event window it is reported relative to */
Window root; /* root window that the event occurred on */
Window subwindow; /* child window */
Time time; /* milliseconds */
int x, y; /* pointer coordinates relative to receiving
window */
int x_root, y_root; /* coordinates relative to root */
unsigned int state; /* button and modifier key mask */
char is_hint; /* is this a motion hint */
Bool same_screen; /* same screen flag */
} XMotionEvent;
typedef XMotionEvent XPointerMovedEvent;
EnterNotify and LeaveNotify events are generated
instead of MotionEvents if the pointer starts and stops in different
windows.
(generated event).
typedef union _XEvent {
...
XPropertyEvent xproperty;
...
} XEvent;
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 window;
Atom atom;
Time time;
int state; /* PropertyNewValue, PropertyDeleted */
} XPropertyEvent;
typedef union _XEvent {
...
XReparentEvent xreparent;
...
} XEvent;
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 event;
Window window;
Window parent;
int x, y;
Bool override_redirect;
} XReparentEvent;
typedef union _XEvent {
...
XResizeRequestEvent xresizerequest;
...
} XEvent;
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 window;
int width, height;
} XResizeRequestEvent;
typedef union _XEvent {
...
XSelectionClearEvent xselectionclear;
...
} XEvent;
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 window;
Atom selection;
Time time;
} XSelectionClearEvent;
typedef union _XEvent {
...
XSelectionEvent xselection;
...
} XEvent;
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;
typedef union _XEvent {
...
XSelectionRequestEvent xselectionrequest;
...
} XEvent;
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 owner;
Window requestor;
Atom selection;
Atom target;
Atom property;
Time time;
} XSelectionRequestEvent;
The owner should convert the selection based on the specified
target type, if possible. 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 by calling XSendEvent.
If the selection cannot be converted as requested, the owner should send
a SelectionNotify event with property set to the constant
None.
(generated event).
typedef union _XEvent {
...
XVisibilityEvent xvisibility;
...
} XEvent;
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 window;
int state; /* VisibilityFullyObscured,
VisibilityPartiallyObscured,
VisibilityUnobscured */
} XVisibilityEvent;
| Visibility Status Before | Visibility Status After | State Member |
|---|---|---|
| Partially obscured, fully obscured, or not viewable | Viewable and completely unobscured | VisibilityUnobscured |
| Viewable and completely unobscured,viewable and fully obscured,or not viewable | Viewable and partially obscured | VisibilityPartially- Obscured |
| Viewable and completely unobscured, viewable and partially obscured,or not viewable | Viewable and partially obscured | VisibilityPartially- Obscured |
Xlib Programming Manual (O'Reilly & Associates, Inc.) |