NotifyGrab

Samuel Thibault samuel.thibault at ens-lyon.org
Fri Dec 22 00:01:04 UTC 2017


Samuel Thibault, on jeu. 21 déc. 2017 18:21:39 +0100, wrote:
> 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 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.

And without the XSetInputFocus call, one gets

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

and

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

i.e. there really is the grab information.

BTW, this is X server core 1.19.5 (Debian Buster up to date)

Samuel


More information about the xorg-devel mailing list