We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3489 - X11: keypress events are delivered twice with certain IMEs
Summary: X11: keypress events are delivered twice with certain IMEs
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 2.0.5
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-12 18:06 UTC by felix
Modified: 2016-11-15 09:19 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description felix 2016-11-12 18:06:04 UTC
Whenever I launch an SDL2 program, every keyboard event is delivered to it twice.

It turns out the culprit is a workaround for IMEs in the X11 video driver. I use UIM; when it sits there idle ('direct' input method), every KeyPress/KeyRelease X11 event is delivered twice: the first time is supposed to be discarded after processing by XFilterEvent and the other is not. SDL, however, specifically delivers events that XFilterEvent indicates should be ignored.

I can work around this problem by emptying the XMODIFIERS variable in the environment of SDL2 apps, disabling the IME.
Comment 1 Sam Lantinga 2016-11-13 08:11:09 UTC
I think this was fixed in changeset 10570.

Can you verify it's fixed by the latest SDL snapshot?
http://www.libsdl.org/tmp/SDL-2.0.zip

Thanks!
Comment 2 felix 2016-11-13 10:23:07 UTC
Yes, it seems that does it. Thank you.
Comment 3 Sam Lantinga 2016-11-15 09:19:56 UTC
Great, thanks!