Fixed: Dead keys under Linux (Ubuntu was using ibus input method)

--HG--
branch : develop
This commit is contained in:
kervala 2016-01-02 11:33:18 +01:00
parent 860a4d99ba
commit 8e57f2ed2e

View file

@ -84,26 +84,36 @@ void CUnixEventEmitter::createIM()
XModifierKeymap *g_mod_map = XGetModifierMapping(_dpy); XModifierKeymap *g_mod_map = XGetModifierMapping(_dpy);
char *modifiers = XSetLocaleModifiers(getenv("XMODIFIERS"));
_im = XOpenIM(_dpy, NULL, NULL, NULL); _im = XOpenIM(_dpy, NULL, NULL, NULL);
if (_im) if (_im == NULL)
{ {
_ic = XCreateIC(_im, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, XNClientWindow, _win, XNFocusWindow, _win, NULL); XSetLocaleModifiers("@im=local");
// XSetICFocus(_ic);
} _im = XOpenIM(_dpy, NULL, NULL, NULL);
else
{ if (_im == NULL)
_ic = 0; {
nlwarning("XCreateIM failed"); XSetLocaleModifiers("@im=");
_im = XOpenIM(_dpy, NULL, NULL, NULL);
if (_im == NULL)
{
nlwarning("XOpenIM failed");
}
}
} }
if (!_ic) if (_im)
{ {
nlwarning("XCreateIC failed"); _ic = XCreateIC(_im, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, XNClientWindow, _win, XNFocusWindow, _win, NULL);
}
if (!_ic)
{
nlwarning("XCreateIC failed");
}
}
#endif #endif
} }