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

Summary: X11: keypress events are delivered twice with certain IMEs
Product: SDL Reporter: felix <felix.von.s>
Component: eventsAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.5   
Hardware: x86_64   
OS: Linux   

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!