Ensure we still clear the X locale modifiers even if not compiled with ibus or fcitx support

This commit is contained in:
Marc Di Luzio 2018-07-12 16:52:45 +01:00
parent b5a420cb11
commit c3178e67ca
1 changed files with 0 additions and 6 deletions

View File

@ -292,9 +292,7 @@ X11_InitKeyboard(_THIS)
char *prev_locale = setlocale(LC_ALL, NULL); char *prev_locale = setlocale(LC_ALL, NULL);
char *prev_xmods = X11_XSetLocaleModifiers(NULL); char *prev_xmods = X11_XSetLocaleModifiers(NULL);
const char *new_xmods = ""; const char *new_xmods = "";
#if defined(HAVE_IBUS_IBUS_H) || defined(HAVE_FCITX_FRONTEND_H)
const char *env_xmods = SDL_getenv("XMODIFIERS"); const char *env_xmods = SDL_getenv("XMODIFIERS");
#endif
SDL_bool has_dbus_ime_support = SDL_FALSE; SDL_bool has_dbus_ime_support = SDL_FALSE;
if (prev_locale) { if (prev_locale) {
@ -309,16 +307,12 @@ X11_InitKeyboard(_THIS)
when it is used via XIM which causes issues. Prevent this by forcing 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 @im=none if XMODIFIERS contains @im=ibus. IBus can still be used via
the DBus implementation, which also has support for pre-editing. */ 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) { if (env_xmods && SDL_strstr(env_xmods, "@im=ibus") != NULL) {
has_dbus_ime_support = SDL_TRUE; has_dbus_ime_support = SDL_TRUE;
} }
#endif
#ifdef HAVE_FCITX_FRONTEND_H
if (env_xmods && SDL_strstr(env_xmods, "@im=fcitx") != NULL) { if (env_xmods && SDL_strstr(env_xmods, "@im=fcitx") != NULL) {
has_dbus_ime_support = SDL_TRUE; has_dbus_ime_support = SDL_TRUE;
} }
#endif
if (has_dbus_ime_support || !xkb_repeat) { if (has_dbus_ime_support || !xkb_repeat) {
new_xmods = "@im=none"; new_xmods = "@im=none";
} }