revert IME support
authorHiltjo Posthuma <hiltjo@codemadness.org>
Sun, 3 Mar 2019 12:08:54 +0000 (13:08 +0100)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Sun, 3 Mar 2019 12:08:54 +0000 (13:08 +0100)
dmenu will not handle IME support (st will, atleast for now).

revert parts of commit 377bd37e212b1ec4c03a481245603c6560d0be22
this commit also broke input focus.

dmenu.c

diff --git a/dmenu.c b/dmenu.c
index 3bfd74d..65f25ce 100644 (file)
--- a/dmenu.c
+++ b/dmenu.c
@@ -553,7 +553,7 @@ run(void)
        XEvent ev;
 
        while (!XNextEvent(dpy, &ev)) {
        XEvent ev;
 
        while (!XNextEvent(dpy, &ev)) {
-               if (XFilterEvent(&ev, None))
+               if (XFilterEvent(&ev, win))
                        continue;
                switch(ev.type) {
                case DestroyNotify:
                        continue;
                switch(ev.type) {
                case DestroyNotify:
@@ -666,20 +666,13 @@ setup(void)
 
 
        /* input methods */
 
 
        /* 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");
-               }
-       }
+       if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL)
+               die("XOpenIM failed: could not open input device");
 
        xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
                        XNClientWindow, win, XNFocusWindow, win, NULL);
 
        XMapRaised(dpy, win);
 
        xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
                        XNClientWindow, win, XNFocusWindow, win, NULL);
 
        XMapRaised(dpy, win);
-       XSetInputFocus(dpy, win, RevertToParent, CurrentTime);
        if (embed) {
                XSelectInput(dpy, parentwin, FocusChangeMask | SubstructureNotifyMask);
                if (XQueryTree(dpy, parentwin, &dw, &w, &dws, &du) && dws) {
        if (embed) {
                XSelectInput(dpy, parentwin, FocusChangeMask | SubstructureNotifyMask);
                if (XQueryTree(dpy, parentwin, &dw, &w, &dws, &du) && dws) {
@@ -745,8 +738,6 @@ main(int argc, char *argv[])
 
        if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
                fputs("warning: no locale support\n", stderr);
 
        if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
                fputs("warning: no locale support\n", stderr);
-       if (!XSetLocaleModifiers(""))
-               fputs("warning: no locale modifiers support\n", stderr);
        if (!(dpy = XOpenDisplay(NULL)))
                die("cannot open display");
        screen = DefaultScreen(dpy);
        if (!(dpy = XOpenDisplay(NULL)))
                die("cannot open display");
        screen = DefaultScreen(dpy);