X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;ds=sidebyside;f=dmenu.c;h=019fa3e29ad30fcca746e09586b31deefff7b27f;hb=56a0d1fa14de915419c037ac2604fe5c5b1fe4a3;hp=d0e27da4f95d686d64dc5c0efb907e78230acda3;hpb=2b31952731bc1c15d9a9521579b7609d50a65f01;p=dmenu.git diff --git a/dmenu.c b/dmenu.c index d0e27da..019fa3e 100644 --- a/dmenu.c +++ b/dmenu.c @@ -117,7 +117,7 @@ main(int argc, char *argv[]) { setup(); run(); - return EXIT_FAILURE; /* unreachable */ + return 1; /* unreachable */ } void @@ -328,6 +328,8 @@ keypress(XKeyEvent *ev) { cursor = nextrune(-1); break; } + if(lines > 0) + return; /* fallthrough */ case XK_Up: if(sel && sel->left && (sel = sel->left)->right == curr) { @@ -356,6 +358,8 @@ keypress(XKeyEvent *ev) { cursor = nextrune(+1); break; } + if(lines > 0) + return; /* fallthrough */ case XK_Down: if(sel && sel->right && (sel = sel->right) == next) { @@ -571,12 +575,12 @@ setup(void) { /* create menu window */ swa.override_redirect = True; - swa.background_pixmap = ParentRelative; + swa.background_pixel = normcol[ColBG]; swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask; win = XCreateWindow(dc->dpy, root, x, y, mw, mh, 0, DefaultDepth(dc->dpy, screen), CopyFromParent, DefaultVisual(dc->dpy, screen), - CWOverrideRedirect | CWBackPixmap | CWEventMask, &swa); + CWOverrideRedirect | CWBackPixel | CWEventMask, &swa); /* open input methods */ xim = XOpenIM(dc->dpy, NULL, NULL, NULL);