renamed char prop[] into buf[]
This commit is contained in:
parent
fc109ea8f7
commit
b18e684015
24
client.c
24
client.c
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
|
|
||||||
static char prop[128];
|
static char buf[128];
|
||||||
|
|
||||||
static void
|
static void
|
||||||
attachstack(Client *c) {
|
attachstack(Client *c) {
|
||||||
|
@ -186,12 +186,12 @@ getprops(Client *c) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
Bool result = False;
|
Bool result = False;
|
||||||
|
|
||||||
if(gettextprop(c->win, dwmprops, prop, sizeof prop)) {
|
if(gettextprop(c->win, dwmprops, buf, sizeof buf)) {
|
||||||
for(i = 0; i < ntags && i < sizeof prop - 1 && prop[i] != '\0'; i++)
|
for(i = 0; i < ntags && i < sizeof buf - 1 && buf[i] != '\0'; i++)
|
||||||
if((c->tags[i] = prop[i] == '1'))
|
if((c->tags[i] = buf[i] == '1'))
|
||||||
result = True;
|
result = True;
|
||||||
if(i < sizeof prop - 1 && prop[i] != '\0')
|
if(i < sizeof buf - 1 && buf[i] != '\0')
|
||||||
c->isfloating = prop[i] == '1';
|
c->isfloating = buf[i] == '1';
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -321,13 +321,13 @@ void
|
||||||
setprops(Client *c) {
|
setprops(Client *c) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
for(i = 0; i < ntags && i < sizeof prop - 1; i++)
|
for(i = 0; i < ntags && i < sizeof buf - 1; i++)
|
||||||
prop[i] = c->tags[i] ? '1' : '0';
|
buf[i] = c->tags[i] ? '1' : '0';
|
||||||
if(i < sizeof prop - 1)
|
if(i < sizeof buf - 1)
|
||||||
prop[i++] = c->isfloating ? '1' : '0';
|
buf[i++] = c->isfloating ? '1' : '0';
|
||||||
prop[i] = '\0';
|
buf[i] = '\0';
|
||||||
XChangeProperty(dpy, c->win, dwmprops, XA_STRING, 8,
|
XChangeProperty(dpy, c->win, dwmprops, XA_STRING, 8,
|
||||||
PropModeReplace, (unsigned char *)prop, i);
|
PropModeReplace, (unsigned char *)buf, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
30
screen.c
30
screen.c
|
@ -28,7 +28,7 @@ typedef struct {
|
||||||
TAGS
|
TAGS
|
||||||
RULES
|
RULES
|
||||||
|
|
||||||
static char prop[512];
|
static char buf[512];
|
||||||
static unsigned int nrules = 0;
|
static unsigned int nrules = 0;
|
||||||
static unsigned int nlayouts = 0;
|
static unsigned int nlayouts = 0;
|
||||||
static unsigned int ltidx = 0; /* default */
|
static unsigned int ltidx = 0; /* default */
|
||||||
|
@ -57,13 +57,13 @@ static void
|
||||||
setdwmprops(void) {
|
setdwmprops(void) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
for(i = 0; i < ntags && i < sizeof prop - 1; i++)
|
for(i = 0; i < ntags && i < sizeof buf - 1; i++)
|
||||||
prop[i] = seltags[i] ? '1' : '0';
|
buf[i] = seltags[i] ? '1' : '0';
|
||||||
if(i < sizeof prop - 1)
|
if(i < sizeof buf - 1)
|
||||||
prop[i++] = (char)ltidx + '0';
|
buf[i++] = (char)ltidx + '0';
|
||||||
prop[i] = '\0';
|
buf[i] = '\0';
|
||||||
XChangeProperty(dpy, root, dwmprops, XA_STRING, 8,
|
XChangeProperty(dpy, root, dwmprops, XA_STRING, 8,
|
||||||
PropModeReplace, (unsigned char *)prop, i);
|
PropModeReplace, (unsigned char *)buf, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
LAYOUTS
|
LAYOUTS
|
||||||
|
@ -81,11 +81,11 @@ applyrules(Client *c) {
|
||||||
|
|
||||||
/* rule matching */
|
/* rule matching */
|
||||||
XGetClassHint(dpy, c->win, &ch);
|
XGetClassHint(dpy, c->win, &ch);
|
||||||
snprintf(prop, sizeof prop, "%s:%s:%s",
|
snprintf(buf, sizeof buf, "%s:%s:%s",
|
||||||
ch.res_class ? ch.res_class : "",
|
ch.res_class ? ch.res_class : "",
|
||||||
ch.res_name ? ch.res_name : "", c->name);
|
ch.res_name ? ch.res_name : "", c->name);
|
||||||
for(i = 0; i < nrules; i++)
|
for(i = 0; i < nrules; i++)
|
||||||
if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) {
|
if(regs[i].propregex && !regexec(regs[i].propregex, buf, 1, &tmp, 0)) {
|
||||||
c->isfloating = rules[i].isfloating;
|
c->isfloating = rules[i].isfloating;
|
||||||
for(j = 0; regs[i].tagregex && j < ntags; j++) {
|
for(j = 0; regs[i].tagregex && j < ntags; j++) {
|
||||||
if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) {
|
if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) {
|
||||||
|
@ -219,12 +219,12 @@ void
|
||||||
getdwmprops(void) {
|
getdwmprops(void) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
if(gettextprop(root, dwmprops, prop, sizeof prop)) {
|
if(gettextprop(root, dwmprops, buf, sizeof buf)) {
|
||||||
for(i = 0; i < ntags && i < sizeof prop - 1 && prop[i] != '\0'; i++)
|
for(i = 0; i < ntags && i < sizeof buf - 1 && buf[i] != '\0'; i++)
|
||||||
seltags[i] = prop[i] == '1';
|
seltags[i] = buf[i] == '1';
|
||||||
if(i < sizeof prop - 1 && prop[i] != '\0') {
|
if(i < sizeof buf - 1 && buf[i] != '\0') {
|
||||||
if((unsigned int)(prop[i] - '0') < nlayouts)
|
if((unsigned int)(buf[i] - '0') < nlayouts)
|
||||||
ltidx = prop[i] - '0';
|
ltidx = buf[i] - '0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue