some cleanups
8b17f551
1 file(s) · +9 −6
| 237 | 237 | /* variables */ |
|
| 238 | 238 | static char stext[256]; |
|
| 239 | 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 | 241 | static int bh, blw = 0; /* bar geometry */ |
|
| 242 | 242 | static int (*xerrorxlib)(Display *, XErrorEvent *); |
|
| 243 | 243 | static unsigned int numlockmask = 0; |
|
| 264 | 264 | static Layout *lt[] = { NULL, NULL }; |
|
| 265 | 265 | static Monitor *mons = NULL, *selmon = NULL; |
|
| 266 | 266 | static Window root; |
|
| 267 | + | ||
| 267 | 268 | /* configuration, allows nested code to access above variables */ |
|
| 268 | 269 | #include "config.h" |
|
| 269 | 270 | ||
| 284 | 285 | r = &rules[i]; |
|
| 285 | 286 | if((!r->title || strstr(c->name, r->title)) |
|
| 286 | 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 | 290 | c->isfloating = r->isfloating; |
|
| 289 | 291 | c->tags |= r->tags; |
|
| 290 | 292 | } |
|
| 305 | 307 | /* set minimum possible */ |
|
| 306 | 308 | *w = MAX(1, *w); |
|
| 307 | 309 | *h = MAX(1, *h); |
|
| 308 | - | ||
| 309 | 310 | if(interact) { |
|
| 310 | 311 | if(*x > sw) |
|
| 311 | 312 | *x = sw - WIDTH(c); |
|
| 903 | 904 | strncpy(text, (char *)name.value, size - 1); |
|
| 904 | 905 | else { |
|
| 905 | 906 | if(XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success |
|
| 906 | - | && n > 0 && *list) { |
|
| 907 | + | && n > 0 && *list) |
|
| 908 | + | { |
|
| 907 | 909 | strncpy(text, *list, size - 1); |
|
| 908 | 910 | XFreeStringList(list); |
|
| 909 | 911 | } |
|
| 928 | 930 | buttons[i].mask | modifiers[j], |
|
| 929 | 931 | c->win, False, BUTTONMASK, |
|
| 930 | 932 | GrabModeAsync, GrabModeSync, None, None); |
|
| 931 | - | } else |
|
| 933 | + | } |
|
| 934 | + | else |
|
| 932 | 935 | XGrabButton(dpy, AnyButton, AnyModifier, c->win, False, |
|
| 933 | 936 | BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); |
|
| 934 | 937 | } |
|
| 1385 | 1388 | ||
| 1386 | 1389 | void |
|
| 1387 | 1390 | setclientstate(Client *c, long state) { |
|
| 1388 | - | long data[] = {state, None}; |
|
| 1391 | + | long data[] = { state, None }; |
|
| 1389 | 1392 | ||
| 1390 | 1393 | XChangeProperty(dpy, c->win, wmatom[WMState], wmatom[WMState], 32, |
|
| 1391 | 1394 | PropModeReplace, (unsigned char *)data, 2); |
|