From 5127b7da8aa720f8c1ab8738a310fdd5d6d36b04 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 2 Jan 2016 11:33:18 +0100 Subject: [PATCH] Fixed: Dead keys under Linux (Ubuntu was using ibus input method) --- .../3d/driver/opengl/unix_event_emitter.cpp | 40 ++++++++++++------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/unix_event_emitter.cpp b/code/nel/src/3d/driver/opengl/unix_event_emitter.cpp index be0736bae..963fecdd8 100644 --- a/code/nel/src/3d/driver/opengl/unix_event_emitter.cpp +++ b/code/nel/src/3d/driver/opengl/unix_event_emitter.cpp @@ -84,26 +84,36 @@ void CUnixEventEmitter::createIM() XModifierKeymap *g_mod_map = XGetModifierMapping(_dpy); - char *modifiers = XSetLocaleModifiers(getenv("XMODIFIERS")); - _im = XOpenIM(_dpy, NULL, NULL, NULL); - if (_im) + if (_im == NULL) { - _ic = XCreateIC(_im, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, XNClientWindow, _win, XNFocusWindow, _win, NULL); -// XSetICFocus(_ic); - } - else - { - _ic = 0; - nlwarning("XCreateIM failed"); - } + XSetLocaleModifiers("@im=local"); + + _im = XOpenIM(_dpy, NULL, NULL, NULL); - if (!_ic) - { - nlwarning("XCreateIC failed"); - } + if (_im == NULL) + { + XSetLocaleModifiers("@im="); + _im = XOpenIM(_dpy, NULL, NULL, NULL); + + if (_im == NULL) + { + nlwarning("XOpenIM failed"); + } + } + } + + if (_im) + { + _ic = XCreateIC(_im, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, XNClientWindow, _win, XNFocusWindow, _win, NULL); + + if (!_ic) + { + nlwarning("XCreateIC failed"); + } + } #endif }