summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R Garbe <anselm@garbe.us>2009-07-02 20:56:23 +0100
committerAnselm R Garbe <anselm@garbe.us>2009-07-02 20:56:23 +0100
commit8b17f5517b12a84a52e9073ace4c8bb9eb6bb941 (patch)
tree20fd0f8eace9c6449fb84ae2c9391b6439957e89
parenthotfix (diff)
downloaddwm-8b17f5517b12a84a52e9073ace4c8bb9eb6bb941.tar.gz
dwm-8b17f5517b12a84a52e9073ace4c8bb9eb6bb941.zip
some cleanups
-rw-r--r--dwm.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/dwm.c b/dwm.c
index 36304c0..9e049c6 100644
--- a/dwm.c
+++ b/dwm.c
@@ -237,7 +237,7 @@ static void zoom(const Arg *arg);
237/* variables */ 237/* variables */
238static char stext[256]; 238static char stext[256];
239static int screen; 239static int screen;
240static int sw, sh; /* X display screen geometry x, y, width, height */ 240static int sw, sh; /* X display screen geometry x, y, width, height */
241static int bh, blw = 0; /* bar geometry */ 241static int bh, blw = 0; /* bar geometry */
242static int (*xerrorxlib)(Display *, XErrorEvent *); 242static int (*xerrorxlib)(Display *, XErrorEvent *);
243static unsigned int numlockmask = 0; 243static unsigned int numlockmask = 0;
@@ -264,6 +264,7 @@ static DC dc;
264static Layout *lt[] = { NULL, NULL }; 264static Layout *lt[] = { NULL, NULL };
265static Monitor *mons = NULL, *selmon = NULL; 265static Monitor *mons = NULL, *selmon = NULL;
266static Window root; 266static 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
1386void 1389void
1387setclientstate(Client *c, long state) { 1390setclientstate(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);