aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2019-03-03 13:08:54 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2019-03-03 13:08:54 +0100
commitdb6093f6ec1bb884f7540f2512935b5254750b30 (patch)
tree00e7aa51d7a05068c8d6d26a98ef4875b16651c3
parenta9b1de384ae1ad30805e893af5cd6ea9b87c89da (diff)
revert IME support
dmenu will not handle IME support (st will, atleast for now). revert parts of commit 377bd37e212b1ec4c03a481245603c6560d0be22 this commit also broke input focus.
-rw-r--r--dmenu.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/dmenu.c b/dmenu.c
index 3bfd74d..65f25ce 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -553,7 +553,7 @@ run(void)
553 XEvent ev; 553 XEvent ev;
554 554
555 while (!XNextEvent(dpy, &ev)) { 555 while (!XNextEvent(dpy, &ev)) {
556 if (XFilterEvent(&ev, None)) 556 if (XFilterEvent(&ev, win))
557 continue; 557 continue;
558 switch(ev.type) { 558 switch(ev.type) {
559 case DestroyNotify: 559 case DestroyNotify:
@@ -666,20 +666,13 @@ setup(void)
666 666
667 667
668 /* input methods */ 668 /* input methods */
669 if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL) { 669 if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL)
670 XSetLocaleModifiers("@im=local"); 670 die("XOpenIM failed: could not open input device");
671 if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL) {
672 XSetLocaleModifiers("@im=");
673 if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL)
674 die("XOpenIM failed: could not open input device");
675 }
676 }
677 671
678 xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, 672 xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
679 XNClientWindow, win, XNFocusWindow, win, NULL); 673 XNClientWindow, win, XNFocusWindow, win, NULL);
680 674
681 XMapRaised(dpy, win); 675 XMapRaised(dpy, win);
682 XSetInputFocus(dpy, win, RevertToParent, CurrentTime);
683 if (embed) { 676 if (embed) {
684 XSelectInput(dpy, parentwin, FocusChangeMask | SubstructureNotifyMask); 677 XSelectInput(dpy, parentwin, FocusChangeMask | SubstructureNotifyMask);
685 if (XQueryTree(dpy, parentwin, &dw, &w, &dws, &du) && dws) { 678 if (XQueryTree(dpy, parentwin, &dw, &w, &dws, &du) && dws) {
@@ -745,8 +738,6 @@ main(int argc, char *argv[])
745 738
746 if (!setlocale(LC_CTYPE, "") || !XSupportsLocale()) 739 if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
747 fputs("warning: no locale support\n", stderr); 740 fputs("warning: no locale support\n", stderr);
748 if (!XSetLocaleModifiers(""))
749 fputs("warning: no locale modifiers support\n", stderr);
750 if (!(dpy = XOpenDisplay(NULL))) 741 if (!(dpy = XOpenDisplay(NULL)))
751 die("cannot open display"); 742 die("cannot open display");
752 screen = DefaultScreen(dpy); 743 screen = DefaultScreen(dpy);