Debugging GUI programs within X can be entertaining. Particularly when it
is a library used by many tools. Also interesting to build a debuging
version og GTK/GDK. Grabbing a handy program to try tracking this bug
down...

(not yet complete)

>From the unclutter side:
The obvious starting point is line 376 of unclutter.c. This is where
the synthesized event controlled by the "-noevents" flag is done. Setting
the flag is claimed to make the problem disappear.

Looking at the code, event type is EnterNotify. Good enough to start
looking from the GTK/GDK side of things. There is a troubling comment on
line 411, "check if a second unclutter is running cos they thrash", this
sounds suspiciously like what is occuring in this circumstance. I'm
wondering whether the test could be enhanced to detect thrashing due to
GTK/GDK, this does not absolve GTK/GDK of guilt though.


>From the GTK/GDK side:
The obvious starting point is to look for handling of EnterNotify events.
I located this in file gdk/x11/gdkevents-x11.c, function
gdk_event_translate(). Working with GDB, I see the following repeating
sequence of X events:

ClientMessage
FocusOut
FocusIn
LeaveNotify
EnterNotify
ClientMessage
FocusOut
FocusIn
EnterNotify

The ClientMessage, FocusOut and FocusIn events appear irrelevant. They
pretty well form a header before the LeaveNotify and EnterNotify events.
I believe the EnterNotify event following the LeaveNotify to be the
genuine one from the X-server; for the EnterNotify event, the detail
field is NotifyAncestor (line 1350). On line 1297 this sets
toplevel->has_pointer to TRUE (however, toplevel->has_pointer is already
TRUE), as a result of line 1366 event->crossing.focus is also set to
TRUE.

The EnterNotify event without the LeaveNotify appears to be the synthetic
one from unclutter that is the immediate cause of problems. Here the
detail field is NotifyInferior (line 1347). On line 1366
event->crossing.focus is set to FALSE.

I have not yet traced where GTK/GDK's half of this fight occurs. It seems
reasonably likely GTK's interpretation of GDK's event->crossing.focus
value is in error. I am troubled by the comments on lines 1294 & 1391,
the problem could well be caused by the attempt to simulate the presence
of a WM.


Currently I am not ready to convict either unclutter or GTK/GDK. As
noted, I do see a spot where this might be worked around in unclutter,
but this does not mean the fault is with unclutter. I am still rather
troubled this is strictly confined to GTK/GDK (programs using Qt or any
other toolkit don't cause problems), this tends to make me suspect
GTK/GDK are the ones misinterpretting X standards, not unclutter.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         e...@gremlin.m5p.com PGP F6B23DE0         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
2477\___\_|_/DC21 03A0 5D61 985B <-PGP-> F2BE 6526 ABD2 F6B2\_|_/___/3DE0





-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to