diff options
-rw-r--r-- | dmenu.c | 15 |
1 files changed, 3 insertions, 12 deletions
@@ -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); |