diff options
-rw-r--r-- | dmenu.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -43,7 +43,7 @@ static void kpress(XKeyEvent *e); | |||
43 | static void match(char *pattern); | 43 | static void match(char *pattern); |
44 | static void readstdin(void); | 44 | static void readstdin(void); |
45 | static void run(void); | 45 | static void run(void); |
46 | static void setup(Bool topbar); | 46 | static void setup(void); |
47 | 47 | ||
48 | #include "config.h" | 48 | #include "config.h" |
49 | #include "draw.h" | 49 | #include "draw.h" |
@@ -63,6 +63,7 @@ static unsigned int mw, mh; | |||
63 | static unsigned long normcol[ColLast]; | 63 | static unsigned long normcol[ColLast]; |
64 | static unsigned long selcol[ColLast]; | 64 | static unsigned long selcol[ColLast]; |
65 | static Bool running = True; | 65 | static Bool running = True; |
66 | static Bool topbar = True; | ||
66 | static DC dc; | 67 | static DC dc; |
67 | static Display *dpy; | 68 | static Display *dpy; |
68 | static Item *allitems = NULL; /* first of all items */ | 69 | static Item *allitems = NULL; /* first of all items */ |
@@ -475,7 +476,7 @@ run(void) { | |||
475 | } | 476 | } |
476 | 477 | ||
477 | void | 478 | void |
478 | setup(Bool topbar) { | 479 | setup(void) { |
479 | int i, j, x, y; | 480 | int i, j, x, y; |
480 | #if XINERAMA | 481 | #if XINERAMA |
481 | int n; | 482 | int n; |
@@ -529,7 +530,8 @@ setup(Bool topbar) { | |||
529 | else | 530 | else |
530 | #endif | 531 | #endif |
531 | { | 532 | { |
532 | XGetWindowAttributes(dpy, parent, &pwa); | 533 | if(!XGetWindowAttributes(dpy, parent, &pwa)) |
534 | eprint("cannot get window attributes"); | ||
533 | x = 0; | 535 | x = 0; |
534 | y = topbar ? 0 : pwa.height - mh; | 536 | y = topbar ? 0 : pwa.height - mh; |
535 | mw = pwa.width; | 537 | mw = pwa.width; |
@@ -553,7 +555,6 @@ setup(Bool topbar) { | |||
553 | int | 555 | int |
554 | main(int argc, char *argv[]) { | 556 | main(int argc, char *argv[]) { |
555 | unsigned int i; | 557 | unsigned int i; |
556 | Bool topbar = True; | ||
557 | 558 | ||
558 | /* command line args */ | 559 | /* command line args */ |
559 | progname = argv[0]; | 560 | progname = argv[0]; |
@@ -613,7 +614,7 @@ main(int argc, char *argv[]) { | |||
613 | readstdin(); | 614 | readstdin(); |
614 | running = grabkeyboard(); | 615 | running = grabkeyboard(); |
615 | 616 | ||
616 | setup(topbar); | 617 | setup(); |
617 | drawmenu(); | 618 | drawmenu(); |
618 | XSync(dpy, False); | 619 | XSync(dpy, False); |
619 | run(); | 620 | run(); |