10.6.2 Grab and Ungrab Entry/Exit Events
Pseudo-motion mode
EnterNotify
and
LeaveNotify
events are generated when a pointer grab activates or deactivates.
Events in which the pointer grab activates
are identified by
XEnterWindowEvent
or
XLeaveWindowEvent
structures whose
mode member is set to
NotifyGrab.
Events in which the pointer grab deactivates
are identified by
XEnterWindowEvent
or
XLeaveWindowEvent
structures whose
mode member is set to
NotifyUngrab
(see
XGrabPointer()).
-
When a pointer grab activates after any initial warp into a confine_to
window and before generating any actual
ButtonPress
event that activates the grab,
G is the grab_window for the grab,
and P is the window the pointer is in,
the X server does the following:
-
It generates
EnterNotify
and
LeaveNotify
events (see "Normal Entry/Exit Events")
with the mode members of the
XEnterWindowEvent
and
XLeaveWindowEvent
structures set to
NotifyGrab.
These events are generated
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 X server uses the pointer position
as both the initial and final positions for the events.
-
When a pointer grab deactivates after generating any actual
ButtonRelease
event that deactivates the grab,
G is the grab_window for the grab,
and P is the window the pointer is in,
the X server does the following:
-
It generates
EnterNotify
and
LeaveNotify
events (see "Normal Entry/Exit Events")
with the mode members of the
XEnterWindowEvent
and
XLeaveWindowEvent
structures set to
NotifyUngrab.
These events are generated as if the pointer were to suddenly warp from
some position in G to its current position in P.
However, the pointer does not warp, and the X server uses the
current pointer position as both the
initial and final positions for the events.
Christophe Tronche, [email protected]