diff options
author | Christoph Lohmann | 2013-01-01 13:15:43 +0100 |
---|---|---|
committer | Christoph Lohmann | 2013-01-01 13:15:43 +0100 |
commit | 4e14a4a97f7f7ef134fdc25d2fa34c8db7bb6e6c (patch) | |
tree | 6a6712face3c4eea19940838bd2d0072120d384a | |
parent | c99db5b0170555c5bb0359ac8a8229cdada64b30 (diff) | |
download | st-4e14a4a97f7f7ef134fdc25d2fa34c8db7bb6e6c.tar.gz st-4e14a4a97f7f7ef134fdc25d2fa34c8db7bb6e6c.tar.xz st-4e14a4a97f7f7ef134fdc25d2fa34c8db7bb6e6c.zip |
A fix for the XopenIM() errors.
-rw-r--r-- | st.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -2503,9 +2503,17 @@ xinit(void) { xw.draw = XftDrawCreate(xw.dpy, xw.buf, xw.vis, xw.cmap); /* input methods */ - xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL); - if(xw.xim == NULL) - die("XOpenIM failed. Could not open input device.\n"); + if((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) { + XSetLocaleModifiers("@im=local"); + if((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) { + XSetLocaleModifiers("@im="); + if((xw.xim = XOpenIM(xw.dpy, + NULL, NULL, NULL)) == NULL) { + die("XOpenIM failed. Could not open input" + " device.\n"); + } + } + } xw.xic = XCreateIC(xw.xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, XNClientWindow, xw.win, XNFocusWindow, xw.win, NULL); |