Xinqi Bao's Git
projects
/
dmenu.git
/ diff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (parent:
c8f0a37
)
xim: check for corner cases
author
Connor Lane Smith <
[email protected]
>
Mon, 17 Oct 2011 00:18:57 +0000
(
01:18
+0100)
committer
Connor Lane Smith <
[email protected]
>
Mon, 17 Oct 2011 00:18:57 +0000
(
01:18
+0100)
dmenu.c
diff
|
blob
|
history
diff --git
a/dmenu.c
b/dmenu.c
index
6d1cdf0
..
895542d
100644
(file)
--- a/
dmenu.c
+++ b/
dmenu.c
@@
-230,11
+230,13
@@
insert(const char *str, ssize_t n) {
void
keypress(XKeyEvent *ev) {
char buf[32];
void
keypress(XKeyEvent *ev) {
char buf[32];
- KeySym ksym;
int len;
int len;
+ KeySym ksym = NoSymbol;
Status status;
Status status;
- len = XmbLookupString(xic, ev, buf, sizeof(buf), &ksym, &status);
+ len = XmbLookupString(xic, ev, buf, sizeof buf, &ksym, &status);
+ if(status == XBufferOverflow)
+ return;
if(ev->state & ControlMask) {
KeySym lower, upper;
if(ev->state & ControlMask) {
KeySym lower, upper;
@@
-549,10
+551,10
@@
setup(void) {
DefaultVisual(dc->dpy, screen),
CWOverrideRedirect | CWBackPixmap | CWEventMask, &swa);
DefaultVisual(dc->dpy, screen),
CWOverrideRedirect | CWBackPixmap | CWEventMask, &swa);
-
/* input methods */
+ /* input methods */
xim = XOpenIM(dc->dpy, NULL, NULL, NULL);
xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
xim = XOpenIM(dc->dpy, NULL, NULL, NULL);
xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
-
XNClientWindow, win, XNFocusWindow, win, NULL);
+ XNClientWindow, win, XNFocusWindow, win, NULL);
XMapRaised(dc->dpy, win);
resizedc(dc, mw, mh);
XMapRaised(dc->dpy, win);
resizedc(dc, mw, mh);