mirror of
https://github.com/encounter/SDL.git
synced 2025-12-17 08:57:01 +00:00
Fixed building and using fcitx IME support on Linux
This commit is contained in:
@@ -397,6 +397,7 @@ X11_VideoInit(_THIS)
|
||||
char *prev_xmods = X11_XSetLocaleModifiers(NULL);
|
||||
const char *new_xmods = "";
|
||||
const char *env_xmods = SDL_getenv("XMODIFIERS");
|
||||
SDL_bool has_dbus_ime_support = SDL_FALSE;
|
||||
|
||||
if (prev_xmods) {
|
||||
prev_xmods = SDL_strdup(prev_xmods);
|
||||
@@ -406,7 +407,17 @@ X11_VideoInit(_THIS)
|
||||
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) {
|
||||
new_xmods = "@im=none";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user