src/video/x11/SDL_x11video.c
changeset 10562 b48d8a98e261
parent 10518 fe8023cff95a
child 10737 3406a0f8b041
     1.1 --- a/src/video/x11/SDL_x11video.c	Fri Oct 28 17:00:37 2016 -0700
     1.2 +++ b/src/video/x11/SDL_x11video.c	Fri Oct 28 01:28:58 2016 +0100
     1.3 @@ -39,10 +39,6 @@
     1.4  #include "SDL_x11opengles.h"
     1.5  #endif
     1.6  
     1.7 -#ifdef X_HAVE_UTF8_STRING
     1.8 -#include <locale.h>
     1.9 -#endif
    1.10 -
    1.11  /* Initialization/Query functions */
    1.12  static int X11_VideoInit(_THIS);
    1.13  static void X11_VideoQuit(_THIS);
    1.14 @@ -388,65 +384,6 @@
    1.15      /* I have no idea how random this actually is, or has to be. */
    1.16      data->window_group = (XID) (((size_t) data->pid) ^ ((size_t) _this));
    1.17  
    1.18 -    /* Open a connection to the X input manager */
    1.19 -#ifdef X_HAVE_UTF8_STRING
    1.20 -    if (SDL_X11_HAVE_UTF8) {
    1.21 -        /* Set the locale, and call XSetLocaleModifiers before XOpenIM so that 
    1.22 -           Compose keys will work correctly. */
    1.23 -        char *prev_locale = setlocale(LC_ALL, NULL);
    1.24 -        char *prev_xmods  = X11_XSetLocaleModifiers(NULL);
    1.25 -        const char *new_xmods = "";
    1.26 -#if defined(HAVE_IBUS_IBUS_H) || defined(HAVE_FCITX_FRONTEND_H)
    1.27 -        const char *env_xmods = SDL_getenv("XMODIFIERS");
    1.28 -#endif
    1.29 -        SDL_bool has_dbus_ime_support = SDL_FALSE;
    1.30 -
    1.31 -        if (prev_locale) {
    1.32 -            prev_locale = SDL_strdup(prev_locale);
    1.33 -        }
    1.34 -
    1.35 -        if (prev_xmods) {
    1.36 -            prev_xmods = SDL_strdup(prev_xmods);
    1.37 -        }
    1.38 -
    1.39 -        /* IBus resends some key events that were filtered by XFilterEvents
    1.40 -           when it is used via XIM which causes issues. Prevent this by forcing
    1.41 -           @im=none if XMODIFIERS contains @im=ibus. IBus can still be used via 
    1.42 -           the DBus implementation, which also has support for pre-editing. */
    1.43 -#ifdef HAVE_IBUS_IBUS_H
    1.44 -        if (env_xmods && SDL_strstr(env_xmods, "@im=ibus") != NULL) {
    1.45 -            has_dbus_ime_support = SDL_TRUE;
    1.46 -        }
    1.47 -#endif
    1.48 -#ifdef HAVE_FCITX_FRONTEND_H
    1.49 -        if (env_xmods && SDL_strstr(env_xmods, "@im=fcitx") != NULL) {
    1.50 -            has_dbus_ime_support = SDL_TRUE;
    1.51 -        }
    1.52 -#endif
    1.53 -        if (has_dbus_ime_support) {
    1.54 -            new_xmods = "@im=none";
    1.55 -        }
    1.56 -
    1.57 -        setlocale(LC_ALL, "");
    1.58 -        X11_XSetLocaleModifiers(new_xmods);
    1.59 -
    1.60 -        data->im = X11_XOpenIM(data->display, NULL, data->classname, data->classname);
    1.61 -
    1.62 -        /* Reset the locale + X locale modifiers back to how they were,
    1.63 -           locale first because the X locale modifiers depend on it. */
    1.64 -        setlocale(LC_ALL, prev_locale);
    1.65 -        X11_XSetLocaleModifiers(prev_xmods);
    1.66 -
    1.67 -        if (prev_locale) {
    1.68 -            SDL_free(prev_locale);
    1.69 -        }
    1.70 -
    1.71 -        if (prev_xmods) {
    1.72 -            SDL_free(prev_xmods);
    1.73 -        }
    1.74 -    }
    1.75 -#endif
    1.76 -
    1.77      /* Look up some useful Atoms */
    1.78  #define GET_ATOM(X) data->X = X11_XInternAtom(data->display, #X, False)
    1.79      GET_ATOM(WM_PROTOCOLS);