fix truncation of long window labels
This commit is contained in:
parent
7f97ee3e9e
commit
67a8397516
1 changed files with 7 additions and 4 deletions
11
manage.c
11
manage.c
|
@ -341,7 +341,7 @@ getcmaps(Client *c)
|
||||||
void
|
void
|
||||||
setlabel(Client *c)
|
setlabel(Client *c)
|
||||||
{
|
{
|
||||||
char *label, *p;
|
char *label, *p, *lc, i;
|
||||||
|
|
||||||
if(c->iconname != 0)
|
if(c->iconname != 0)
|
||||||
label = c->iconname;
|
label = c->iconname;
|
||||||
|
@ -355,9 +355,12 @@ setlabel(Client *c)
|
||||||
label = "no label";
|
label = "no label";
|
||||||
if((p = index(label, ':')) != 0)
|
if((p = index(label, ':')) != 0)
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
if (sizeof(label) >= 16*sizeof(char)){
|
for (lc = label, i = 0; lc++, i++; *lc != 0){
|
||||||
label[15] = '~';
|
if (i >= 24)
|
||||||
label[18] = '\0';
|
{
|
||||||
|
label[22] = '~';
|
||||||
|
label[23] = '\0';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
c->label = label;
|
c->label = label;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue