summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranselm@x200s.config <unknown>2009-07-12 22:49:06 +0100
committeranselm@x200s.config <unknown>2009-07-12 22:49:06 +0100
commit8dc9fcf1b95db927ce50a63c7e571fdb074529e8 (patch)
treea6b6ae0b0289d52e752bf275c1164f57cb83213f
parentfixing updatetitle (diff)
downloaddwm-8dc9fcf1b95db927ce50a63c7e571fdb074529e8.tar.gz
dwm-8dc9fcf1b95db927ce50a63c7e571fdb074529e8.zip
mark broken clients as broken
-rw-r--r--dwm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/dwm.c b/dwm.c
index bfeae15..553194d 100644
--- a/dwm.c
+++ b/dwm.c
@@ -237,6 +237,7 @@ static int xerrorstart(Display *dpy, XErrorEvent *ee);
237static void zoom(const Arg *arg); 237static void zoom(const Arg *arg);
238 238
239/* variables */ 239/* variables */
240static const char broken[] = "broken";
240static char stext[256], ntext[8]; 241static char stext[256], ntext[8];
241static int screen; 242static int screen;
242static int sw, sh; /* X display screen geometry width, height */ 243static int sw, sh; /* X display screen geometry width, height */
@@ -275,6 +276,7 @@ struct NumTags { char limitexceeded[sizeof(unsigned int) * 8 < LENGTH(tags) ? -1
275/* function implementations */ 276/* function implementations */
276void 277void
277applyrules(Client *c) { 278applyrules(Client *c) {
279 const char *class, *instance;
278 unsigned int i; 280 unsigned int i;
279 const Rule *r; 281 const Rule *r;
280 Monitor *m; 282 Monitor *m;
@@ -283,11 +285,13 @@ applyrules(Client *c) {
283 /* rule matching */ 285 /* rule matching */
284 c->isfloating = c->tags = 0; 286 c->isfloating = c->tags = 0;
285 if(XGetClassHint(dpy, c->win, &ch)) { 287 if(XGetClassHint(dpy, c->win, &ch)) {
288 class = ch.res_class ? ch.res_class : broken;
289 instance = ch.res_name ? ch.res_name : broken;
286 for(i = 0; i < LENGTH(rules); i++) { 290 for(i = 0; i < LENGTH(rules); i++) {
287 r = &rules[i]; 291 r = &rules[i];
288 if((!r->title || strstr(c->name, r->title)) 292 if((!r->title || strstr(c->name, r->title))
289 && (!r->class || (ch.res_class && strstr(ch.res_class, r->class))) 293 && (!r->class || strstr(class, r->class))
290 && (!r->instance || (ch.res_name && strstr(ch.res_name, r->instance)))) 294 && (!r->instance || strstr(instance, r->instance)))
291 { 295 {
292 c->isfloating = r->isfloating; 296 c->isfloating = r->isfloating;
293 c->tags |= r->tags; 297 c->tags |= r->tags;
@@ -1819,6 +1823,8 @@ void
1819updatetitle(Client *c) { 1823updatetitle(Client *c) {
1820 if(!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name)) 1824 if(!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name))
1821 gettextprop(c->win, XA_WM_NAME, c->name, sizeof c->name); 1825 gettextprop(c->win, XA_WM_NAME, c->name, sizeof c->name);
1826 if(c->name[0] == '\0') /* hack to mark broken clients */
1827 strcpy(c->name, broken);
1822} 1828}
1823 1829
1824void 1830void