diff options
| -rw-r--r-- | dinput.c | 6 | ||||
| -rw-r--r-- | dmenu.c | 16 | ||||
| -rw-r--r-- | draw.h | 21 | 
3 files changed, 31 insertions, 12 deletions
| @@ -43,6 +43,12 @@ static unsigned int numlockmask = 0; | |||
| 43 | static Bool running = True; | 43 | static Bool running = True; | 
| 44 | static Window win; | 44 | static Window win; | 
| 45 | 45 | ||
| 46 | Display *dpy; | ||
| 47 | DC dc; | ||
| 48 | int screen; | ||
| 49 | unsigned int mw, mh; | ||
| 50 | Window parent; | ||
| 51 | |||
| 46 | void | 52 | void | 
| 47 | cleanup(void) { | 53 | cleanup(void) { | 
| 48 | drawcleanup(); | 54 | drawcleanup(); | 
| @@ -54,6 +54,7 @@ static char text[4096]; | |||
| 54 | static int cmdw = 0; | 54 | static int cmdw = 0; | 
| 55 | static int promptw = 0; | 55 | static int promptw = 0; | 
| 56 | static int ret = 0; | 56 | static int ret = 0; | 
| 57 | static unsigned int lines = 0; | ||
| 57 | static unsigned int numlockmask = 0; | 58 | static unsigned int numlockmask = 0; | 
| 58 | static Bool running = True; | 59 | static Bool running = True; | 
| 59 | static Item *allitems = NULL; /* first of all items */ | 60 | static Item *allitems = NULL; /* first of all items */ | 
| @@ -65,9 +66,14 @@ static Item *curr = NULL; | |||
| 65 | static Window win; | 66 | static Window win; | 
| 66 | static int (*fstrncmp)(const char *, const char *, size_t) = strncmp; | 67 | static int (*fstrncmp)(const char *, const char *, size_t) = strncmp; | 
| 67 | static char *(*fstrstr)(const char *, const char *) = strstr; | 68 | static char *(*fstrstr)(const char *, const char *) = strstr; | 
| 68 | static unsigned int lines = 0; | ||
| 69 | static void (*calcoffsets)(void) = calcoffsetsh; | 69 | static void (*calcoffsets)(void) = calcoffsetsh; | 
| 70 | 70 | ||
| 71 | Display *dpy; | ||
| 72 | DC dc; | ||
| 73 | int screen; | ||
| 74 | unsigned int mw, mh; | ||
| 75 | Window parent; | ||
| 76 | |||
| 71 | void | 77 | void | 
| 72 | appenditem(Item *i, Item **list, Item **last) { | 78 | appenditem(Item *i, Item **list, Item **last) { | 
| 73 | if(!(*last)) | 79 | if(!(*last)) | 
| @@ -131,6 +137,14 @@ cistrstr(const char *s, const char *sub) { | |||
| 131 | 137 | ||
| 132 | void | 138 | void | 
| 133 | cleanup(void) { | 139 | cleanup(void) { | 
| 140 | Item *itm; | ||
| 141 | |||
| 142 | while(allitems) { | ||
| 143 | itm = allitems->next; | ||
| 144 | free(allitems->text); | ||
| 145 | free(allitems); | ||
| 146 | allitems = itm; | ||
| 147 | } | ||
| 134 | drawcleanup(); | 148 | drawcleanup(); | 
| 135 | XDestroyWindow(dpy, win); | 149 | XDestroyWindow(dpy, win); | 
| 136 | XUngrabKeyboard(dpy, CurrentTime); | 150 | XUngrabKeyboard(dpy, CurrentTime); | 
| @@ -30,16 +30,15 @@ int textnw(const char *text, unsigned int len); | |||
| 30 | int textw(const char *text); | 30 | int textw(const char *text); | 
| 31 | 31 | ||
| 32 | /* variables */ | 32 | /* variables */ | 
| 33 | Display *dpy; | 33 | extern Display *dpy; | 
| 34 | DC dc; | 34 | extern DC dc; | 
| 35 | int screen; | 35 | extern int screen; | 
| 36 | unsigned int mw, mh; | 36 | extern unsigned int mw, mh; | 
| 37 | unsigned int spaceitem; | 37 | extern Window parent; | 
| 38 | Window parent; | ||
| 39 | 38 | ||
| 40 | /* style */ | 39 | /* style */ | 
| 41 | const char *font; | 40 | extern const char *font; | 
| 42 | const char *normbgcolor; | 41 | extern const char *normbgcolor; | 
| 43 | const char *normfgcolor; | 42 | extern const char *normfgcolor; | 
| 44 | const char *selbgcolor; | 43 | extern const char *selbgcolor; | 
| 45 | const char *selfgcolor; | 44 | extern const char *selfgcolor; | 
