make loadprops more dynamic
This commit is contained in:
parent
de225777b2
commit
aa4177c2b1
12
client.c
12
client.c
|
@ -199,7 +199,6 @@ ban(Client * c)
|
||||||
c->unmapped++;
|
c->unmapped++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Configure client
|
/** Configure client
|
||||||
* \param c the client
|
* \param c the client
|
||||||
*/
|
*/
|
||||||
|
@ -310,17 +309,22 @@ static Bool
|
||||||
loadprops(Client * c, int ntags)
|
loadprops(Client * c, int ntags)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char prop[128];
|
char *prop;
|
||||||
Bool result = False;
|
Bool result = False;
|
||||||
|
|
||||||
|
prop = p_new(char, ntags + 2);
|
||||||
|
|
||||||
if(gettextprop(c->display, c->win, jdwmprops, prop, sizeof(prop)))
|
if(gettextprop(c->display, c->win, jdwmprops, prop, sizeof(prop)))
|
||||||
{
|
{
|
||||||
for(i = 0; i < ntags && i < ssizeof(prop) - 1 && prop[i] != '\0'; i++)
|
for(i = 0; i < ntags && prop[i]; i++)
|
||||||
if((c->tags[i] = prop[i] == '1'))
|
if((c->tags[i] = prop[i] == '1'))
|
||||||
result = True;
|
result = True;
|
||||||
if(i < ssizeof(prop) - 1 && prop[i] != '\0')
|
if(i <= ntags && prop[i])
|
||||||
c->isfloating = prop[i] == '1';
|
c->isfloating = prop[i] == '1';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p_delete(&prop);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue