[hackers] [dmenu] Handle IME input || Quentin Rameau

From: <git_AT_suckless.org>
Date: Sun, 22 Apr 2018 14:34:23 +0200 (CEST)

commit 377bd37e212b1ec4c03a481245603c6560d0be22
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Mon Mar 19 15:42:28 2018 +0100
Commit: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
CommitDate: Sun Apr 22 14:09:05 2018 +0200

    Handle IME input
    
    Thanks to nzl <uruabi_AT_gmail.com> for the patch!

diff --git a/dmenu.c b/dmenu.c
index c852e92..314256f 100644
--- a/dmenu.c
+++ b/dmenu.c
_AT_@ -552,7 +552,7 @@ run(void)
         XEvent ev;
 
         while (!XNextEvent(dpy, &ev)) {
- if (XFilterEvent(&ev, win))
+ if (XFilterEvent(&ev, None))
                         continue;
                 switch(ev.type) {
                 case Expose:
_AT_@ -664,6 +664,7 @@ setup(void)
                         XNClientWindow, win, XNFocusWindow, win, NULL);
 
         XMapRaised(dpy, win);
+ XSetInputFocus(dpy, win, RevertToParent, CurrentTime);
         if (embed) {
                 XSelectInput(dpy, parentwin, FocusChangeMask);
                 if (XQueryTree(dpy, parentwin, &dw, &w, &dws, &du) && dws) {
_AT_@ -729,6 +730,8 @@ main(int argc, char *argv[])
 
         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);
Received on Sun Apr 22 2018 - 14:34:23 CEST

This archive was generated by hypermail 2.3.0 : Sun Apr 22 2018 - 14:36:43 CEST