summaryrefslogtreecommitdiffstats
path: root/screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/screen.c b/screen.c
index a8b093c..ec8637f 100644
--- a/screen.c
+++ b/screen.c
@@ -28,7 +28,7 @@ typedef struct {
28TAGS 28TAGS
29RULES 29RULES
30 30
31static char prop[512]; 31static char buf[512];
32static unsigned int nrules = 0; 32static unsigned int nrules = 0;
33static unsigned int nlayouts = 0; 33static unsigned int nlayouts = 0;
34static unsigned int ltidx = 0; /* default */ 34static unsigned int ltidx = 0; /* default */
@@ -57,13 +57,13 @@ static void
57setdwmprops(void) { 57setdwmprops(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
69LAYOUTS 69LAYOUTS
@@ -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
219getdwmprops(void) { 219getdwmprops(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}