Commit ed53aca1 authored by Egbert Eich's avatar Egbert Eich Committed by Ulrich Sibiller

XIM: Fix race on focus change: set 'FABRICATED' only when keyev filters in place.

When synthesized key events are sent on commit XIM sets the 'fabricated' flag so that the keypress handler knows that these were not real events. This also happens when committing due to the loss of focus. However in this case the keypress/release filters which consume and unset this flag are no longer in the filter chain. So the flag is erronously set when a real keyboard event is received after focus has been regained. So the first event is wrongly treated as a fabricated key in the keypress handler which will at the same time reset the flag so the second key event is treated correctly. This fix only sets the flag when at least one of the keyboard filters is in place. How to reproduce this bug: run scim, choose a Japanese input method start two instances of xterm: start typing in one xterm (this should pop up an IM window). Without comitting (hitting 'enter') move focus to the other xterm, then move focus back. Start typing again. The first character will be committed immediately without popping up an input window. With this fix this behavior is gone. See also: https://bugzilla.novell.com/show_bug.cgi?id=239698Signed-off-by: 's avatarEgbert Eich <eich@freedesktop.org> Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
parent adcf3894
......@@ -704,7 +704,9 @@ _XimCommitRecv(
(void)_XimRespSyncReply(ic, flag);
MARK_FABRICATED(im);
if (ic->private.proto.registed_filter_event
& (KEYPRESS_MASK | KEYRELEASE_MASK))
MARK_FABRICATED(im);
ev.type = KeyPress;
ev.send_event = False;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment