Unpredictable Behaviour with XI2 and XI_Enter

Florian Echtler floe at butterbrot.org
Tue Jun 16 14:31:07 PDT 2009


Hello everybody (esp. Peter ;-),

I tried to get to the bottom of my lost XI_Enter events today. As I
mentioned, I'm not getting those events which should occur when a cursor
is inside the window when it is first created. I've experimented a bit
with the relevant part from xinput, and I've stripped it down to a
minimal example which shows the problem (source code attached).

It seems to be some kind of race condition: if there is any significant
delay between creation of the window and the first call to XNextEvent,
then the XI_Event is very unlikely to arrive, as opposed to the standard
EnterNotify. After removing the sleep(1) in the code, it works almost
always. The standard events are never lost, neither are any subsequent
XI_Enter or XI_Leave events. It's only the very first one, and only if
the cursor is already inside the window upon creation.

My xserver, inputproto, libXi and xinput have been rebuilt from FDO git
master yesterday. I'd really appreciate it if some of you with more
inside knowledge could have a look at this and tell me if I am
forgetting something..

Yours, Florian
-- 
0666 - Filemode of the Beast
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xi2test.c
Type: text/x-csrc
Size: 2181 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20090616/1ec952dc/attachment.c>


More information about the xorg mailing list