- commit
- 60f496a915eec951a06992a676944a194035ed5a
- parent
- 1ec24eeadc363ab07f56a1c68fa9315a53b81e66
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2019-10-13 10:13
convert constants to real constants
Diffstat
| M | config.def.h | 8 | ++++---- |
| M | xiwm.c | 17 | +++++++++-------- |
2 files changed, 13 insertions, 12 deletions
diff --git a/config.def.h b/config.def.h
@@ -1,10 +1,10 @@ 1 1 /* See LICENSE file for copyright and license details. */ 2 2 3 3 /* appearance */4 -1 static const unsigned int desktops = 3;5 -1 static const unsigned int inidesktop = 1;6 -1 static const unsigned int col_norm = 0x444444;7 -1 static const unsigned int col_high = 0x335588;-1 4 #define DESKTOPS 3 -1 5 #define INIDESKTOP 1 -1 6 #define COL_NORM 0x444444 -1 7 #define COL_HIGH 0x335588 8 8 9 9 static const Rule rules[] = { 10 10 /* xprop(1):
diff --git a/xiwm.c b/xiwm.c
@@ -89,6 +89,9 @@ static void maprequest(XEvent *e); 89 89 /* signals */ 90 90 static void sigchld(int unused); 91 91 -1 92 /* configuration, allows nested code to access above variables */ -1 93 #include "config.h" -1 94 92 95 /* variables */ 93 96 static const char broken[] = "broken"; 94 97 static int sw, sh; /* X display screen geometry width, height */ @@ -110,9 +113,6 @@ static Display *dpy; 110 113 static Client *clients, *sel; 111 114 static Window root, wmcheckwin; 112 115113 -1 /* configuration, allows nested code to access above variables */114 -1 #include "config.h"115 -1116 116 void 117 117 die(const char *fmt, ...) { 118 118 va_list ap; @@ -367,7 +367,7 @@ setfullscreen(Client *c, Bool fullscreen) 367 367 void 368 368 setdesktop(unsigned int i) 369 369 {370 -1 if (i == desktop || i > desktops)-1 370 if (i == desktop || i > DESKTOPS) 371 371 return; 372 372 desktop = i; 373 373 XChangeProperty(dpy, root, netatom[NetCurrentDesktop], XA_CARDINAL, 32, @@ -468,10 +468,10 @@ focus(Client *c) 468 468 for (c = clients; c && !ISVISIBLE(c); c = c->next); 469 469 if (sel && sel != c) { 470 470 grabbuttons(sel, False);471 -1 XSetWindowBorder(dpy, sel->win, col_norm);-1 471 XSetWindowBorder(dpy, sel->win, COL_NORM); 472 472 } 473 473 if (c) {474 -1 XSetWindowBorder(dpy, c->win, col_high);-1 474 XSetWindowBorder(dpy, c->win, COL_HIGH); 475 475 grabbuttons(c, True); 476 476 XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); 477 477 XChangeProperty(dpy, root, netatom[NetActiveWindow], XA_WINDOW, 32, @@ -512,7 +512,7 @@ manage(Window w, XWindowAttributes *wa) 512 512 if (c->isdock) 513 513 bh = c->h; 514 514515 -1 XSetWindowBorder(dpy, c->win, col_norm);-1 515 XSetWindowBorder(dpy, c->win, COL_NORM); 516 516 XSelectInput(dpy, w, WINMASK); 517 517 grabbuttons(c, False); 518 518 attach(c); @@ -843,6 +843,7 @@ setup(void) 843 843 { 844 844 int screen; 845 845 Atom utf8string; -1 846 const unsigned int desktops = DESKTOPS; 846 847 847 848 XSync(dpy, False); 848 849 XSetErrorHandler(xerror); @@ -895,7 +896,7 @@ setup(void) 895 896 /* select events */ 896 897 XSelectInput(dpy, root, ROOTMASK); 897 898 grabkeys();898 -1 setdesktop(inidesktop);-1 899 setdesktop(INIDESKTOP); 899 900 focus(NULL); 900 901 } 901 902