Event redirection issue: determining the type of triggered grabs
Deron Johnson
Deron.Johnson at Sun.COM
Wed Jan 18 12:52:12 PST 2006
I think I have hit on a solution that should require no changes to the
X server.
When a 3D client invokes an active grab, instead of invoking the
active grab on the pseudo-root window, the grab will be invoked on a
special "active grab window" created by the display server for this
purpose. Events which return to the display server via this window
will be known to be from an active grab. This will give me enough
information to figure out which specific 3D object the active grab was
invoked upon.
Having solved the problem of active grabs, this leaves only the
problem of distinguishing between user-registered passive grabs and
the default grab. In the 3D proxy window design, there must be a 3D
proxy window for a 3D object which has user-registered passive grabs.
The Picker will assign the PRW window ID an event when it hits a 3D
object which doesn't have any user-registered grabs. But when the
event hits a 3D object with user-registered grabs, the event will be
assigned the window ID of the corresponding 3D proxy window.
Therefore, we know that if an Enter event with NotifyGrab is generated
for the PRW window that the grab which triggered it must necessarily
be the default button grab, because otherwise the window ID would be
one of the 3D proxy windows. In this case, the Display Server can
figure out the corresponding 3D object node by using the object of the
last motion event.
So here is what we have so far:
1. Each time an Enter event with NotifyGrab is generated and the
entered window is the special active grab window an active
grab has been newly triggered. Fetch the 3D grab object from
the head of the queue which the Display Server maintains for
this purpose.
2. If an Enter event with NotifyGrab is generated and the entered
window is the PRW, a default button grab has triggered. Fetch
the 3D grab object from the last motion event.
3. If an Enter event which NotifyGrab is generated and the entered
window is a 3D proxy window, fetch the 3D grab object from the
mapping between 3D objects and their corresponding proxy windows.
(Note that in this case it doesn't matter whether it was the
default button grab or a user-registered grab that triggered--
the display server doesn't actually use any information from
the grab itself. The only thing which matters is the grab cursor
and that is handled via cursor notify events).
I believe this presents a solution for how to map the window
ID of the grab-triggered Enter events to the correct 3D object.
Please check my logic on this. Thanks.
More information about the xorg-arch
mailing list