NotifyGrab

Samuel Thibault samuel.thibault at ens-lyon.org
Thu Dec 21 17:21:39 UTC 2017


Samuel Thibault, on jeu. 21 déc. 2017 17:50:54 +0100, wrote:
> One additionnal piece of information: it seems that what makes compiz
> have the issue (compared to my simple X root event listener) is the call
> to
> 
> XSetInputFocus (s->dpy (), priv->id, RevertToPointerRoot, CurrentTime);
> 
> on the window that after that acquires the grab.

Here are reproducers.

- First run focus-grab on a bare X server
- then run grab, which opens a window on the top left corner.
- Move the mouse to it.
  -> in focus-grab the enter notify handler calls XSetInputFocus [*]
- press the g key  

The result is this: On the ./grab side:

focus out 4194305 0
focus in 4194305 0
0: ||
1: |g|
0:1|g|
res 0

I.e. it got the 'g' keypress event, and successfully called XGrabKeyboard.
And on the ./focus-grab side:

started
create 4194305
enter 4194305 0
1
core focus out 4194305 0
core focus out 38 0
core focus out 38 0
core focus in 38 0
core focus in 4194305 0
focus out 6 0
key press 7 7 77 0
key press 7 7 42 0
key release 7 7 42 0

I.e. it saw the creation of the window, catched entering the window
and set XSetInputFocus, which generate focus events, then saw the 'g'
keypress (77 is my numlock) but didn't see any grab-related focus
events. That's my concern.

Samuel

[*] I know it's useless since that's the X server default, but calling
it that way avoids to put into the reproducer the machinery of catching
clicks etc. to call XSetInputFocus at the right point.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: focus-grab.c
Type: text/x-csrc
Size: 3921 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20171221/fa6f1539/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grab.c
Type: text/x-csrc
Size: 2316 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20171221/fa6f1539/attachment-0001.c>


More information about the xorg-devel mailing list