diff options
| -rw-r--r-- | client.c | 24 | ||||
| -rw-r--r-- | screen.c | 30 |
2 files changed, 27 insertions, 27 deletions
| @@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | /* static */ | 8 | /* static */ |
| 9 | 9 | ||
| 10 | static char prop[128]; | 10 | static char buf[128]; |
| 11 | 11 | ||
| 12 | static void | 12 | static void |
| 13 | attachstack(Client *c) { | 13 | attachstack(Client *c) { |
| @@ -186,12 +186,12 @@ getprops(Client *c) { | |||
| 186 | unsigned int i; | 186 | unsigned int i; |
| 187 | Bool result = False; | 187 | Bool result = False; |
| 188 | 188 | ||
| 189 | if(gettextprop(c->win, dwmprops, prop, sizeof prop)) { | 189 | if(gettextprop(c->win, dwmprops, buf, sizeof buf)) { |
| 190 | for(i = 0; i < ntags && i < sizeof prop - 1 && prop[i] != '\0'; i++) | 190 | for(i = 0; i < ntags && i < sizeof buf - 1 && buf[i] != '\0'; i++) |
| 191 | if((c->tags[i] = prop[i] == '1')) | 191 | if((c->tags[i] = buf[i] == '1')) |
| 192 | result = True; | 192 | result = True; |
| 193 | if(i < sizeof prop - 1 && prop[i] != '\0') | 193 | if(i < sizeof buf - 1 && buf[i] != '\0') |
| 194 | c->isfloating = prop[i] == '1'; | 194 | c->isfloating = buf[i] == '1'; |
| 195 | } | 195 | } |
| 196 | return result; | 196 | return result; |
| 197 | } | 197 | } |
| @@ -321,13 +321,13 @@ void | |||
| 321 | setprops(Client *c) { | 321 | setprops(Client *c) { |
| 322 | unsigned int i; | 322 | unsigned int i; |
| 323 | 323 | ||
| 324 | for(i = 0; i < ntags && i < sizeof prop - 1; i++) | 324 | for(i = 0; i < ntags && i < sizeof buf - 1; i++) |
| 325 | prop[i] = c->tags[i] ? '1' : '0'; | 325 | buf[i] = c->tags[i] ? '1' : '0'; |
| 326 | if(i < sizeof prop - 1) | 326 | if(i < sizeof buf - 1) |
| 327 | prop[i++] = c->isfloating ? '1' : '0'; | 327 | buf[i++] = c->isfloating ? '1' : '0'; |
| 328 | prop[i] = '\0'; | 328 | buf[i] = '\0'; |
| 329 | XChangeProperty(dpy, c->win, dwmprops, XA_STRING, 8, | 329 | XChangeProperty(dpy, c->win, dwmprops, XA_STRING, 8, |
| 330 | PropModeReplace, (unsigned char *)prop, i); | 330 | PropModeReplace, (unsigned char *)buf, i); |
| 331 | } | 331 | } |
| 332 | 332 | ||
| 333 | void | 333 | void |
| @@ -28,7 +28,7 @@ typedef struct { | |||
| 28 | TAGS | 28 | TAGS |
| 29 | RULES | 29 | RULES |
| 30 | 30 | ||
| 31 | static char prop[512]; | 31 | static char buf[512]; |
| 32 | static unsigned int nrules = 0; | 32 | static unsigned int nrules = 0; |
| 33 | static unsigned int nlayouts = 0; | 33 | static unsigned int nlayouts = 0; |
| 34 | static unsigned int ltidx = 0; /* default */ | 34 | static unsigned int ltidx = 0; /* default */ |
| @@ -57,13 +57,13 @@ static void | |||
| 57 | setdwmprops(void) { | 57 | setdwmprops(void) { |
| 58 | unsigned int i; | 58 | unsigned int i; |
| 59 | 59 | ||
| 60 | for(i = 0; i < ntags && i < sizeof prop - 1; i++) | 60 | for(i = 0; i < ntags && i < sizeof buf - 1; i++) |
| 61 | prop[i] = seltags[i] ? '1' : '0'; | 61 | buf[i] = seltags[i] ? '1' : '0'; |
| 62 | if(i < sizeof prop - 1) | 62 | if(i < sizeof buf - 1) |
| 63 | prop[i++] = (char)ltidx + '0'; | 63 | buf[i++] = (char)ltidx + '0'; |
| 64 | prop[i] = '\0'; | 64 | buf[i] = '\0'; |
| 65 | XChangeProperty(dpy, root, dwmprops, XA_STRING, 8, | 65 | XChangeProperty(dpy, root, dwmprops, XA_STRING, 8, |
| 66 | PropModeReplace, (unsigned char *)prop, i); | 66 | PropModeReplace, (unsigned char *)buf, i); |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | LAYOUTS | 69 | LAYOUTS |
| @@ -81,11 +81,11 @@ applyrules(Client *c) { | |||
| 81 | 81 | ||
| 82 | /* rule matching */ | 82 | /* rule matching */ |
| 83 | XGetClassHint(dpy, c->win, &ch); | 83 | XGetClassHint(dpy, c->win, &ch); |
| 84 | snprintf(prop, sizeof prop, "%s:%s:%s", | 84 | snprintf(buf, sizeof buf, "%s:%s:%s", |
| 85 | ch.res_class ? ch.res_class : "", | 85 | ch.res_class ? ch.res_class : "", |
| 86 | ch.res_name ? ch.res_name : "", c->name); | 86 | ch.res_name ? ch.res_name : "", c->name); |
| 87 | for(i = 0; i < nrules; i++) | 87 | for(i = 0; i < nrules; i++) |
| 88 | if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) { | 88 | if(regs[i].propregex && !regexec(regs[i].propregex, buf, 1, &tmp, 0)) { |
| 89 | c->isfloating = rules[i].isfloating; | 89 | c->isfloating = rules[i].isfloating; |
| 90 | for(j = 0; regs[i].tagregex && j < ntags; j++) { | 90 | for(j = 0; regs[i].tagregex && j < ntags; j++) { |
| 91 | if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) { | 91 | if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) { |
| @@ -219,12 +219,12 @@ void | |||
| 219 | getdwmprops(void) { | 219 | getdwmprops(void) { |
| 220 | unsigned int i; | 220 | unsigned int i; |
| 221 | 221 | ||
| 222 | if(gettextprop(root, dwmprops, prop, sizeof prop)) { | 222 | if(gettextprop(root, dwmprops, buf, sizeof buf)) { |
| 223 | for(i = 0; i < ntags && i < sizeof prop - 1 && prop[i] != '\0'; i++) | 223 | for(i = 0; i < ntags && i < sizeof buf - 1 && buf[i] != '\0'; i++) |
| 224 | seltags[i] = prop[i] == '1'; | 224 | seltags[i] = buf[i] == '1'; |
| 225 | if(i < sizeof prop - 1 && prop[i] != '\0') { | 225 | if(i < sizeof buf - 1 && buf[i] != '\0') { |
| 226 | if((unsigned int)(prop[i] - '0') < nlayouts) | 226 | if((unsigned int)(buf[i] - '0') < nlayouts) |
| 227 | ltidx = prop[i] - '0'; | 227 | ltidx = buf[i] - '0'; |
| 228 | } | 228 | } |
| 229 | } | 229 | } |
| 230 | } | 230 | } |
