diff options
| author | anselm@x200s.config <unknown> | 2009-07-12 22:49:06 +0100 |
|---|---|---|
| committer | anselm@x200s.config <unknown> | 2009-07-12 22:49:06 +0100 |
| commit | 8dc9fcf1b95db927ce50a63c7e571fdb074529e8 (patch) | |
| tree | a6b6ae0b0289d52e752bf275c1164f57cb83213f /dwm.c | |
| parent | fixing updatetitle (diff) | |
| download | dwm-8dc9fcf1b95db927ce50a63c7e571fdb074529e8.tar.gz dwm-8dc9fcf1b95db927ce50a63c7e571fdb074529e8.zip | |
mark broken clients as broken
Diffstat (limited to '')
| -rw-r--r-- | dwm.c | 10 |
1 files changed, 8 insertions, 2 deletions
| @@ -237,6 +237,7 @@ static int xerrorstart(Display *dpy, XErrorEvent *ee); | |||
| 237 | static void zoom(const Arg *arg); | 237 | static void zoom(const Arg *arg); |
| 238 | 238 | ||
| 239 | /* variables */ | 239 | /* variables */ |
| 240 | static const char broken[] = "broken"; | ||
| 240 | static char stext[256], ntext[8]; | 241 | static char stext[256], ntext[8]; |
| 241 | static int screen; | 242 | static int screen; |
| 242 | static int sw, sh; /* X display screen geometry width, height */ | 243 | static 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 */ |
| 276 | void | 277 | void |
| 277 | applyrules(Client *c) { | 278 | applyrules(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 | |||
| 1819 | updatetitle(Client *c) { | 1823 | updatetitle(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 | ||
| 1824 | void | 1830 | void |
