removed some global vars which should be static instead
52f0b9e2
2 file(s) · +7 −8
| 87 | 87 | ||
| 88 | 88 | extern const char *tags[]; /* all tags */ |
|
| 89 | 89 | extern char stext[256]; /* status text */ |
|
| 90 | - | extern int screen, sx, sy, sw, sh; /* screen geometry */ |
|
| 90 | + | extern int screen, sw, sh; /* screen geometry */ |
|
| 91 | 91 | extern int wax, way, wah, waw; /* windowarea geometry */ |
|
| 92 | 92 | extern unsigned int bh, blw; /* bar height, bar layout label width */ |
|
| 93 | 93 | extern unsigned int master, nmaster; /* master percent, number of master clients */ |
|
| 94 | 94 | extern unsigned int ntags, numlockmask; /* number of tags, dynamic lock mask */ |
|
| 95 | 95 | extern void (*handler[LASTEvent])(XEvent *); /* event handler */ |
|
| 96 | 96 | extern Atom wmatom[WMLast], netatom[NetLast]; |
|
| 97 | - | extern Bool running, selscreen, *seltag; /* seltag is array of Bool */ |
|
| 97 | + | extern Bool selscreen, *seltag; /* seltag is array of Bool */ |
|
| 98 | 98 | extern Client *clients, *sel, *stack; /* global client list and stack */ |
|
| 99 | 99 | extern Cursor cursor[CurLast]; |
|
| 100 | 100 | extern DC dc; /* global draw context */ |
| 18 | 18 | /* extern */ |
|
| 19 | 19 | ||
| 20 | 20 | char stext[256]; |
|
| 21 | - | int screen, sx, sy, sw, sh, wax, way, waw, wah; |
|
| 21 | + | int screen, sw, sh, wax, way, waw, wah; |
|
| 22 | 22 | unsigned int bh, ntags, numlockmask; |
|
| 23 | 23 | Atom wmatom[WMLast], netatom[NetLast]; |
|
| 24 | - | Bool running = True; |
|
| 25 | 24 | Bool *seltag; |
|
| 26 | 25 | Bool selscreen = True; |
|
| 27 | 26 | Client *clients = NULL; |
|
| 36 | 35 | ||
| 37 | 36 | static int (*xerrorxlib)(Display *, XErrorEvent *); |
|
| 38 | 37 | static Bool otherwm, readin; |
|
| 38 | + | static Bool running = True; |
|
| 39 | 39 | ||
| 40 | 40 | static void |
|
| 41 | 41 | cleanup(void) { |
|
| 181 | 181 | dc.sel[ColFG] = initcolor(SELFGCOLOR); |
|
| 182 | 182 | initfont(FONT); |
|
| 183 | 183 | /* geometry */ |
|
| 184 | - | sx = sy = 0; |
|
| 185 | 184 | sw = DisplayWidth(dpy, screen); |
|
| 186 | 185 | sh = DisplayHeight(dpy, screen); |
|
| 187 | 186 | initlayouts(); |
|
| 190 | 189 | wa.override_redirect = 1; |
|
| 191 | 190 | wa.background_pixmap = ParentRelative; |
|
| 192 | 191 | wa.event_mask = ButtonPressMask | ExposureMask; |
|
| 193 | - | barwin = XCreateWindow(dpy, root, sx, sy + (TOPBAR ? 0 : sh - bh), sw, bh, 0, |
|
| 192 | + | barwin = XCreateWindow(dpy, root, 0, (TOPBAR ? 0 : sh - bh), sw, bh, 0, |
|
| 194 | 193 | DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), |
|
| 195 | 194 | CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); |
|
| 196 | 195 | XDefineCursor(dpy, barwin, cursor[CurNormal]); |
|
| 197 | 196 | XMapRaised(dpy, barwin); |
|
| 198 | 197 | strcpy(stext, "dwm-"VERSION); |
|
| 199 | 198 | /* windowarea */ |
|
| 200 | - | wax = sx; |
|
| 201 | - | way = sy + (TOPBAR ? bh : 0); |
|
| 199 | + | wax = 0; |
|
| 200 | + | way = (TOPBAR ? bh : 0); |
|
| 202 | 201 | wah = sh - bh; |
|
| 203 | 202 | waw = sw; |
|
| 204 | 203 | /* pixmap for everything */ |
|