aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor Lane Smith <cls@lubutu.com>2010-06-30 00:05:32 +0100
committerConnor Lane Smith <cls@lubutu.com>2010-06-30 00:05:32 +0100
commitcc8b3b999ba0153029b1e5a97ebbd59563f9e7bb (patch)
tree2ab4e6ab2b426351006b0b77902de4a65b12d6eb
parentf2abaf8b308bc25d9c5f26d3ea3818516dd477d9 (diff)
cleaned up
-rw-r--r--dmenu.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/dmenu.c b/dmenu.c
index 9e30add..2d53f9b 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -43,7 +43,7 @@ static void kpress(XKeyEvent *e);
43static void match(char *pattern); 43static void match(char *pattern);
44static void readstdin(void); 44static void readstdin(void);
45static void run(void); 45static void run(void);
46static void setup(Bool topbar); 46static 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;
63static unsigned long normcol[ColLast]; 63static unsigned long normcol[ColLast];
64static unsigned long selcol[ColLast]; 64static unsigned long selcol[ColLast];
65static Bool running = True; 65static Bool running = True;
66static Bool topbar = True;
66static DC dc; 67static DC dc;
67static Display *dpy; 68static Display *dpy;
68static Item *allitems = NULL; /* first of all items */ 69static Item *allitems = NULL; /* first of all items */
@@ -475,7 +476,7 @@ run(void) {
475} 476}
476 477
477void 478void
478setup(Bool topbar) { 479setup(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) {
553int 555int
554main(int argc, char *argv[]) { 556main(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();