diff options
| author | Anselm R Garbe <anselm@garbe.us> | 2009-07-02 20:56:23 +0100 |
|---|---|---|
| committer | Anselm R Garbe <anselm@garbe.us> | 2009-07-02 20:56:23 +0100 |
| commit | 8b17f5517b12a84a52e9073ace4c8bb9eb6bb941 (patch) | |
| tree | 20fd0f8eace9c6449fb84ae2c9391b6439957e89 /dwm.c | |
| parent | hotfix (diff) | |
| download | dwm-8b17f5517b12a84a52e9073ace4c8bb9eb6bb941.tar.gz dwm-8b17f5517b12a84a52e9073ace4c8bb9eb6bb941.zip | |
some cleanups
Diffstat (limited to 'dwm.c')
| -rw-r--r-- | dwm.c | 15 |
1 files changed, 9 insertions, 6 deletions
| @@ -237,7 +237,7 @@ static void zoom(const Arg *arg); | |||
| 237 | /* variables */ | 237 | /* variables */ |
| 238 | static char stext[256]; | 238 | static char stext[256]; |
| 239 | static int screen; | 239 | static int screen; |
| 240 | static int sw, sh; /* X display screen geometry x, y, width, height */ | 240 | static int sw, sh; /* X display screen geometry x, y, width, height */ |
| 241 | static int bh, blw = 0; /* bar geometry */ | 241 | static int bh, blw = 0; /* bar geometry */ |
| 242 | static int (*xerrorxlib)(Display *, XErrorEvent *); | 242 | static int (*xerrorxlib)(Display *, XErrorEvent *); |
| 243 | static unsigned int numlockmask = 0; | 243 | static unsigned int numlockmask = 0; |
| @@ -264,6 +264,7 @@ static DC dc; | |||
| 264 | static Layout *lt[] = { NULL, NULL }; | 264 | static Layout *lt[] = { NULL, NULL }; |
| 265 | static Monitor *mons = NULL, *selmon = NULL; | 265 | static Monitor *mons = NULL, *selmon = NULL; |
| 266 | static Window root; | 266 | static Window root; |
| 267 | |||
| 267 | /* configuration, allows nested code to access above variables */ | 268 | /* configuration, allows nested code to access above variables */ |
| 268 | #include "config.h" | 269 | #include "config.h" |
| 269 | 270 | ||
| @@ -284,7 +285,8 @@ applyrules(Client *c) { | |||
| 284 | r = &rules[i]; | 285 | r = &rules[i]; |
| 285 | if((!r->title || strstr(c->name, r->title)) | 286 | if((!r->title || strstr(c->name, r->title)) |
| 286 | && (!r->class || (ch.res_class && strstr(ch.res_class, r->class))) | 287 | && (!r->class || (ch.res_class && strstr(ch.res_class, r->class))) |
| 287 | && (!r->instance || (ch.res_name && strstr(ch.res_name, r->instance)))) { | 288 | && (!r->instance || (ch.res_name && strstr(ch.res_name, r->instance)))) |
| 289 | { | ||
| 288 | c->isfloating = r->isfloating; | 290 | c->isfloating = r->isfloating; |
| 289 | c->tags |= r->tags; | 291 | c->tags |= r->tags; |
| 290 | } | 292 | } |
| @@ -305,7 +307,6 @@ applysizehints(Client *c, int *x, int *y, int *w, int *h, Bool interact) { | |||
| 305 | /* set minimum possible */ | 307 | /* set minimum possible */ |
| 306 | *w = MAX(1, *w); | 308 | *w = MAX(1, *w); |
| 307 | *h = MAX(1, *h); | 309 | *h = MAX(1, *h); |
| 308 | |||
| 309 | if(interact) { | 310 | if(interact) { |
| 310 | if(*x > sw) | 311 | if(*x > sw) |
| 311 | *x = sw - WIDTH(c); | 312 | *x = sw - WIDTH(c); |
| @@ -903,7 +904,8 @@ gettextprop(Window w, Atom atom, char *text, unsigned int size) { | |||
| 903 | strncpy(text, (char *)name.value, size - 1); | 904 | strncpy(text, (char *)name.value, size - 1); |
| 904 | else { | 905 | else { |
| 905 | if(XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success | 906 | if(XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success |
| 906 | && n > 0 && *list) { | 907 | && n > 0 && *list) |
| 908 | { | ||
| 907 | strncpy(text, *list, size - 1); | 909 | strncpy(text, *list, size - 1); |
| 908 | XFreeStringList(list); | 910 | XFreeStringList(list); |
| 909 | } | 911 | } |
| @@ -928,7 +930,8 @@ grabbuttons(Client *c, Bool focused) { | |||
| 928 | buttons[i].mask | modifiers[j], | 930 | buttons[i].mask | modifiers[j], |
| 929 | c->win, False, BUTTONMASK, | 931 | c->win, False, BUTTONMASK, |
| 930 | GrabModeAsync, GrabModeSync, None, None); | 932 | GrabModeAsync, GrabModeSync, None, None); |
| 931 | } else | 933 | } |
| 934 | else | ||
| 932 | XGrabButton(dpy, AnyButton, AnyModifier, c->win, False, | 935 | XGrabButton(dpy, AnyButton, AnyModifier, c->win, False, |
| 933 | BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); | 936 | BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); |
| 934 | } | 937 | } |
| @@ -1385,7 +1388,7 @@ sendmon(Client *c, Monitor *m) { | |||
| 1385 | 1388 | ||
| 1386 | void | 1389 | void |
| 1387 | setclientstate(Client *c, long state) { | 1390 | setclientstate(Client *c, long state) { |
| 1388 | long data[] = {state, None}; | 1391 | long data[] = { state, None }; |
| 1389 | 1392 | ||
| 1390 | XChangeProperty(dpy, c->win, wmatom[WMState], wmatom[WMState], 32, | 1393 | XChangeProperty(dpy, c->win, wmatom[WMState], wmatom[WMState], 32, |
| 1391 | PropModeReplace, (unsigned char *)data, 2); | 1394 | PropModeReplace, (unsigned char *)data, 2); |
