X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=dmenu.c;h=ae56f4fbced707105d4cbfbf4faabcaee6dd6ffc;hb=43b0c2c3dd3e694cf674097d493ef6630efc5403;hp=f8031497c8e116a9c6e045857d679e75445fd033;hpb=153aaf88bf9bf5c6c4b118bd871f8cf1eafdcab5;p=dmenu.git diff --git a/dmenu.c b/dmenu.c index f803149..ae56f4f 100644 --- a/dmenu.c +++ b/dmenu.c @@ -664,8 +664,17 @@ setup(void) CWOverrideRedirect | CWBackPixel | CWEventMask, &swa); XSetClassHint(dpy, win, &ch); - /* open input methods */ - xim = XOpenIM(dpy, NULL, NULL, NULL); + + /* input methods */ + if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL) { + XSetLocaleModifiers("@im=local"); + if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL) { + XSetLocaleModifiers("@im="); + if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL) + die("XOpenIM failed. Could not open input device.\n"); + } + } + xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, XNClientWindow, win, XNFocusWindow, win, NULL);