• Egbert Eich's avatar
    XIM: Fix race on focus change: set 'FABRICATED' only when keyev filters in place. · ed53aca1
    Egbert Eich authored
    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>
    ed53aca1
imDefLkup.c 26.2 KB