when a desktop is focused but not occupied, include it in the display
This commit is contained in:
parent
c97943855f
commit
474ac61f6e
14
bspc.c
14
bspc.c
|
@ -309,14 +309,20 @@ int bspwm_update(struct module *module) {
|
|||
current[1] = '\0';
|
||||
|
||||
for(int i = 0; i < MODULE_BUFFER_LEN; i++) {
|
||||
if(module->buffer[i] == '\0') {
|
||||
/* XXX: susceptible to buffer underflow */
|
||||
if(i) module->buffer[i - 1] = '\0';
|
||||
if(module->buffer[i] == '\0' && i) {
|
||||
if(*current != '\0' && i <= MODULE_BUFFER_LEN - 2) {
|
||||
module->buffer[i - 1] = ' ';
|
||||
module->buffer[i] = *current;
|
||||
module->buffer[i + 1] = '<';
|
||||
module->buffer[i + 2] = '\0';
|
||||
} else module->buffer[i - 1] = '\0';
|
||||
break;
|
||||
}
|
||||
if(isdigit(module->buffer[i]) && *current == module->buffer[i])
|
||||
if(isdigit(module->buffer[i]) && *current == module->buffer[i]) {
|
||||
/* XXX: susceptible to buffer overflow */
|
||||
if(i == MODULE_BUFFER_LEN) module->buffer[i + 1] = '<';
|
||||
*current = '\0';
|
||||
}
|
||||
if(module->buffer[i] == '\n')
|
||||
module->buffer[i] = ' ';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue