X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=main.c;h=224d298ff002e7c87b6fbbd2bdc8d4e070e7c058;hb=2bac5599b3e7629875d692b65a336915ecfee49d;hp=59b3a7235c19688e40452ae660bc1a3432e7c7ff;hpb=b6cd6ed2661693c90c1c6e7119a8ac4a0b09e7e1;p=dmenu.git diff --git a/main.c b/main.c index 59b3a72..224d298 100644 --- a/main.c +++ b/main.c @@ -28,7 +28,7 @@ struct Item { static char text[4096]; static char *prompt = NULL; -static int mx, my, mw, mh; +static int mw, mh; static int ret = 0; static int nitem = 0; static unsigned int cmdw = 0; @@ -342,7 +342,6 @@ DC dc = {0}; int main(int argc, char *argv[]) { - Bool bottom = False; char *font = FONT; char *maxname; char *normbg = NORMBGCOLOR; @@ -361,10 +360,7 @@ main(int argc, char *argv[]) { timeout.tv_sec = 3; /* command line args */ for(i = 1; i < argc; i++) - if(!strncmp(argv[i], "-b", 3)) { - bottom = True; - } - else if(!strncmp(argv[i], "-fn", 4)) { + if(!strncmp(argv[i], "-fn", 4)) { if(++i < argc) font = argv[i]; } else if(!strncmp(argv[i], "-nb", 4)) { @@ -390,7 +386,7 @@ main(int argc, char *argv[]) { exit(EXIT_SUCCESS); } else - eprint("usage: dmenu [-b] [-fn ] [-nb ] [-nf ] [-p ]\n" + eprint("usage: dmenu [-fn ] [-nb ] [-nf ] [-p ]\n" " [-sb ] [-sf ] [-t ] [-v]\n", stdout); setlocale(LC_CTYPE, ""); dpy = XOpenDisplay(0); @@ -431,12 +427,10 @@ main(int argc, char *argv[]) { wa.override_redirect = 1; wa.background_pixmap = ParentRelative; wa.event_mask = ExposureMask | ButtonPressMask | KeyPressMask; - mx = my = 0; mw = DisplayWidth(dpy, screen); mh = dc.font.height + 2; - if(bottom) - my += DisplayHeight(dpy, screen) - mh; - win = XCreateWindow(dpy, root, mx, my, mw, mh, 0, + win = XCreateWindow(dpy, root, 0, + DisplayHeight(dpy, screen) - mh, mw, mh, 0, DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);