xim: check for corner cases
This commit is contained in:
parent
c8f0a37638
commit
24565608cb
10
dmenu.c
10
dmenu.c
|
@ -230,11 +230,13 @@ insert(const char *str, ssize_t n) {
|
||||||
void
|
void
|
||||||
keypress(XKeyEvent *ev) {
|
keypress(XKeyEvent *ev) {
|
||||||
char buf[32];
|
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) {
|
if(ev->state & ControlMask) {
|
||||||
KeySym lower, upper;
|
KeySym lower, upper;
|
||||||
|
|
||||||
|
@ -549,10 +551,10 @@ setup(void) {
|
||||||
DefaultVisual(dc->dpy, screen),
|
DefaultVisual(dc->dpy, screen),
|
||||||
CWOverrideRedirect | CWBackPixmap | CWEventMask, &swa);
|
CWOverrideRedirect | CWBackPixmap | CWEventMask, &swa);
|
||||||
|
|
||||||
/* input methods */
|
/* input methods */
|
||||||
xim = XOpenIM(dc->dpy, NULL, NULL, NULL);
|
xim = XOpenIM(dc->dpy, NULL, NULL, NULL);
|
||||||
xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
|
xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
|
||||||
XNClientWindow, win, XNFocusWindow, win, NULL);
|
XNClientWindow, win, XNFocusWindow, win, NULL);
|
||||||
|
|
||||||
XMapRaised(dc->dpy, win);
|
XMapRaised(dc->dpy, win);
|
||||||
resizedc(dc, mw, mh);
|
resizedc(dc, mw, mh);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user