Commit Diff


commit - 68d1ad9b54e952e3079356aeab8ab37e44c56c2c
commit + e5e959835b195c023d1f685ef4dbbcfc3b5120b2
blob - 2a3bd384c46560d5a1067c065efee4a3dc206f4b
blob + aa0999708da84930a9752da8dd6d5bdc9991bb5d
--- x.c
+++ x.c
@@ -1833,7 +1833,7 @@ void
 kpress(XEvent *ev)
 {
 	XKeyEvent *e = &ev->xkey;
-	KeySym ksym;
+	KeySym ksym = NoSymbol;
 	char buf[64], *customkey;
 	int len;
 	Rune c;
@@ -1843,10 +1843,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)) {