Hi Matt,
sorry it's taken me so long to reply … too many things on the list.
Am 20.07.2016 um 20:48 schrieb Matthew D. Fuller:
In the abstract, focus processing is pretty simple. We
XSetInputFocus() to a window when it's entered, and to the root when
it's left. What can go wrong?
[…]
It'll probably take some deterministic way of triggering, plus a good
bit of time dribbling printf()'s around the code to find what's
happening oddly.
I managed to make a transcript of the X-events as far as they can be
grabbed by xev with the version that works for me (Jabref 2.10).
I moved the mouse pointer into the window, clicked into the "Web Search"
dialogue and typed some text there, but even in this case, with no
apparent focus problems, some things appearing pretty weird to me
happen; here's the transcript:
%xev -id 0x1000033
MOUSE ENTERS JABREF-WINDOW:
EnterNotify event, serial 18, synthetic NO, window 0x1000033,
root 0x250, subw 0x100003a, time 3606814, (625,740), root:(631,769),
mode NotifyNormal, detail NotifyVirtual, same_screen YES,
focus NO, state 2
KeymapNotify event, serial 18, synthetic NO, window 0x0,
keys: 80 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
CLICKING IN WEB SEARCH TEXT INPUT AREA THERE:
EnterNotify event, serial 18, synthetic NO, window 0x1000033,
root 0x250, subw 0x0, time 3626539, (29,114), root:(35,143),
mode NotifyGrab, detail NotifyInferior, same_screen YES,
focus NO, state 258
KeymapNotify event, serial 18, synthetic NO, window 0x0,
keys: 80 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
FocusIn event, serial 18, synthetic NO, window 0x1000033,
mode NotifyNormal, detail NotifyNonlinear
KeymapNotify event, serial 18, synthetic NO, window 0x0,
keys: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
LeaveNotify event, serial 18, synthetic NO, window 0x1000033,
root 0x250, subw 0x0, time 3626547, (29,114), root:(35,143),
mode NotifyUngrab, detail NotifyInferior, same_screen YES,
focus YES, state 258
FocusOut event, serial 18, synthetic NO, window 0x1000033,
mode NotifyNormal, detail NotifyInferior
LeaveNotify event, serial 18, synthetic NO, window 0x1000033,
root 0x250, subw 0x100003a, time 3708334, (631,700), root:(637,729),
mode NotifyNormal, detail NotifyVirtual, same_screen YES,
focus NO, state 2
FocusOut event, serial 18, synthetic NO, window 0x1000033,
mode NotifyNormal, detail NotifyNonlinearVirtual
TYPING SOME TEXT IN WEB SEARCH TEXT AREA:
(NO EVENTS PRODUCED, BUT TEXT APPEARS!)
MOVING MOUSE OUT OF WINDOW AND OVER X-BACKGROUND:
LeaveNotify event, serial 18, synthetic NO, window 0x1000033,
root 0x250, subw 0x100003a, time 3938280, (628,985), root:(634,1014),
mode NotifyNormal, detail NotifyVirtual, same_screen YES,
focus YES, state 0
TYPING SOME TEXT WITH FOCUS STILL ON JABREF BUT MOUSE OVER X-BACKGROUND:
KeyPress event, serial 18, synthetic NO, window 0x1000033,
root 0x250, subw 0x0, time 3947542, (648,990), root:(654,1019),
state 0x0, keycode 38 (keysym 0x61, a), same_screen YES,
XLookupString gives 1 bytes: (61) "a"
XmbLookupString gives 1 bytes: (61) "a"
XFilterEvent returns: False
KeyRelease event, serial 21, synthetic NO, window 0x1000033,
root 0x250, subw 0x0, time 3947674, (648,990), root:(654,1019),
state 0x0, keycode 38 (keysym 0x61, a), same_screen YES,
XLookupString gives 1 bytes: (61) "a"
XFilterEvent returns: False
KeyPress event, serial 21, synthetic NO, window 0x1000033,
root 0x250, subw 0x0, time 3947877, (648,990), root:(654,1019),
state 0x0, keycode 56 (keysym 0x62, b), same_screen YES,
XLookupString gives 1 bytes: (62) "b"
XmbLookupString gives 1 bytes: (62) "b"
XFilterEvent returns: False
KeyRelease event, serial 21, synthetic NO, window 0x1000033,
root 0x250, subw 0x0, time 3947995, (648,990), root:(654,1019),
state 0x0, keycode 56 (keysym 0x62, b), same_screen YES,
XLookupString gives 1 bytes: (62) "b"
XFilterEvent returns: False
KeyPress event, serial 21, synthetic NO, window 0x1000033,
root 0x250, subw 0x0, time 3948268, (648,990), root:(654,1019),
state 0x0, keycode 54 (keysym 0x63, c), same_screen YES,
XLookupString gives 1 bytes: (63) "c"
XmbLookupString gives 1 bytes: (63) "c"
XFilterEvent returns: False
KeyRelease event, serial 21, synthetic NO, window 0x1000033,
root 0x250, subw 0x0, time 3948329, (648,990), root:(654,1019),
state 0x0, keycode 54 (keysym 0x63, c), same_screen YES,
XLookupString gives 1 bytes: (63) "c"
XFilterEvent returns: False
The strangest thing – to me – is that not a single KeyPress event is
generated when typing text in the dialogue, but only when typing over
the X-Background with keyboard focus still on the Jabref-window, but
then again, I'm certainly not an X-pert. ;)
Does the transcript make any sense to you?
Best regards
Alexander
--
Alexander Klein
Physiologisches Institut der JLU-Gießen
Aulweg 129
35392 Gießen
http://www.med.uni-giessen.de/physio/