diff options
Diffstat (limited to 'dwm.c')
| -rw-r--r-- | dwm.c | 17 |
1 files changed, 9 insertions, 8 deletions
| @@ -99,7 +99,9 @@ typedef struct { | |||
| 99 | } Layout; | 99 | } Layout; |
| 100 | 100 | ||
| 101 | typedef struct { | 101 | typedef struct { |
| 102 | const char *prop; | 102 | const char *class; |
| 103 | const char *instance; | ||
| 104 | const char *title; | ||
| 103 | const char *tag; | 105 | const char *tag; |
| 104 | Bool isfloating; | 106 | Bool isfloating; |
| 105 | } Rule; | 107 | } Rule; |
| @@ -161,7 +163,7 @@ void restack(void); | |||
| 161 | void run(void); | 163 | void run(void); |
| 162 | void scan(void); | 164 | void scan(void); |
| 163 | void setclientstate(Client *c, long state); | 165 | void setclientstate(Client *c, long state); |
| 164 | void setdefaultgeoms(void); | 166 | void setdefgeoms(void); |
| 165 | void setlayout(const char *arg); | 167 | void setlayout(const char *arg); |
| 166 | void setup(void); | 168 | void setup(void); |
| 167 | void spawn(const char *arg); | 169 | void spawn(const char *arg); |
| @@ -224,7 +226,6 @@ Display *dpy; | |||
| 224 | DC dc = {0}; | 226 | DC dc = {0}; |
| 225 | Layout *lt = NULL; | 227 | Layout *lt = NULL; |
| 226 | Window root, barwin; | 228 | Window root, barwin; |
| 227 | void (*setgeoms)(void) = setdefaultgeoms; | ||
| 228 | 229 | ||
| 229 | /* configuration, allows nested code to access above variables */ | 230 | /* configuration, allows nested code to access above variables */ |
| 230 | #include "config.h" | 231 | #include "config.h" |
| @@ -244,9 +245,9 @@ applyrules(Client *c) { | |||
| 244 | XGetClassHint(dpy, c->win, &ch); | 245 | XGetClassHint(dpy, c->win, &ch); |
| 245 | for(i = 0; i < LENGTH(rules); i++) { | 246 | for(i = 0; i < LENGTH(rules); i++) { |
| 246 | r = &rules[i]; | 247 | r = &rules[i]; |
| 247 | if(strstr(c->name, r->prop) | 248 | if(strstr(c->name, r->title) |
| 248 | || (ch.res_class && strstr(ch.res_class, r->prop)) | 249 | || (ch.res_class && r->class && strstr(ch.res_class, r->class)) |
| 249 | || (ch.res_name && strstr(ch.res_name, r->prop))) | 250 | || (ch.res_name && r->instance && strstr(ch.res_name, r->instance))) |
| 250 | { | 251 | { |
| 251 | c->isfloating = r->isfloating; | 252 | c->isfloating = r->isfloating; |
| 252 | if(r->tag) { | 253 | if(r->tag) { |
| @@ -1051,7 +1052,7 @@ maprequest(XEvent *e) { | |||
| 1051 | } | 1052 | } |
| 1052 | 1053 | ||
| 1053 | void | 1054 | void |
| 1054 | monocle(void) { | 1055 | monocle(void) { |
| 1055 | Client *c; | 1056 | Client *c; |
| 1056 | 1057 | ||
| 1057 | for(c = clients; c; c = c->next) | 1058 | for(c = clients; c; c = c->next) |
| @@ -1390,7 +1391,7 @@ setclientstate(Client *c, long state) { | |||
| 1390 | } | 1391 | } |
| 1391 | 1392 | ||
| 1392 | void | 1393 | void |
| 1393 | setdefaultgeoms(void) { | 1394 | setdefgeoms(void) { |
| 1394 | 1395 | ||
| 1395 | /* screen dimensions */ | 1396 | /* screen dimensions */ |
| 1396 | sx = 0; | 1397 | sx = 0; |
