summaryrefslogtreecommitdiff
path: root/x.c
diff options
context:
space:
mode:
Diffstat (limited to 'x.c')
-rw-r--r--x.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/x.c b/x.c
index d734ebd..9be49e3 100644
--- a/x.c
+++ b/x.c
@@ -1945,7 +1945,7 @@ void
kpress(XEvent *ev)
{
XKeyEvent *e = &ev->xkey;
- KeySym ksym;
+ KeySym ksym = NoSymbol;
char buf[64], *customkey;
int len;
Rune c;
@@ -1955,10 +1955,13 @@ kpress(XEvent *ev)
if (IS_SET(MODE_KBDLOCK))
return;
- if (xw.ime.xic)
+ if (xw.ime.xic) {
len = XmbLookupString(xw.ime.xic, e, buf, sizeof buf, &ksym, &status);
- else
+ if (status == XBufferOverflow)
+ return;
+ } else {
len = XLookupString(e, buf, sizeof buf, &ksym, NULL);
+ }
/* 1. shortcuts */
for (bp = shortcuts; bp < shortcuts + LEN(shortcuts); bp++) {
if (ksym == bp->keysym && match(bp->mod, e->state)) {