| Summary: | Key events can be buffered when compiling without Ibus support on an Ibus supported system | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Marc Di Luzio <marcdi> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | marcdi |
| Version: | 2.0.8 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: | Simple reproduction file | ||
|
Description
Marc Di Luzio
2018-07-12 16:08:45 UTC
This patch fixes the issue locally. It simple ensures SDL still sets "@im=none" on systems that have ibus/fcitx support, regardless of whether SDL itself was configured with direct support. # HG changeset patch # User Marc Di Luzio <marcdi@unity3d.com> # Date 1531410765 -3600 # Thu Jul 12 16:52:45 2018 +0100 # Node ID 44ebedcfe8bf4b244d0cedb83019cc65985b6e83 # Parent 1a1133e9c7d40416af82e97711f91f5a857ffc54 Ensure we still clear the X locale modifiers even if not compiled with ibus or fcitx support diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c --- a/src/video/x11/SDL_x11keyboard.c +++ b/src/video/x11/SDL_x11keyboard.c @@ -292,9 +292,7 @@ char *prev_locale = setlocale(LC_ALL, NULL); char *prev_xmods = X11_XSetLocaleModifiers(NULL); const char *new_xmods = ""; -#if defined(HAVE_IBUS_IBUS_H) || defined(HAVE_FCITX_FRONTEND_H) const char *env_xmods = SDL_getenv("XMODIFIERS"); -#endif SDL_bool has_dbus_ime_support = SDL_FALSE; if (prev_locale) { @@ -309,16 +307,12 @@ when it is used via XIM which causes issues. Prevent this by forcing @im=none if XMODIFIERS contains @im=ibus. IBus can still be used via the DBus implementation, which also has support for pre-editing. */ -#ifdef HAVE_IBUS_IBUS_H if (env_xmods && SDL_strstr(env_xmods, "@im=ibus") != NULL) { has_dbus_ime_support = SDL_TRUE; } -#endif -#ifdef HAVE_FCITX_FRONTEND_H if (env_xmods && SDL_strstr(env_xmods, "@im=fcitx") != NULL) { has_dbus_ime_support = SDL_TRUE; } -#endif if (has_dbus_ime_support || !xkb_repeat) { new_xmods = "@im=none"; } Just to add a little more info for the repro file - when running, hold a keyboard key for more than a second and see the output. Release the key, and see that the events keep repeating for an extended period of time. SDL_PollEvent should be returning true if it has events queued, but it doesn't, they're still buffered in X. Patch added, thanks! https://hg.libsdl.org/SDL/rev/5b6f649b6488 |