mirror of
https://github.com/swaywm/sway.git
synced 2024-11-11 13:04:11 +01:00
Merge pull request #841 from thejan2009/tabbed-title-avoiding-null
Display class in container title if app_id is null
This commit is contained in:
commit
e8ca63702e
@ -228,15 +228,13 @@ static char *generate_container_title(swayc_t *container) {
|
|||||||
for (i = 0; i < container->children->length; ++i) {
|
for (i = 0; i < container->children->length; ++i) {
|
||||||
prev_name = name;
|
prev_name = name;
|
||||||
swayc_t* child = container->children->items[i];
|
swayc_t* child = container->children->items[i];
|
||||||
const char *title = child->app_id;
|
const char *title = NULL;
|
||||||
if (child->type == C_CONTAINER) {
|
if (child->type == C_VIEW) {
|
||||||
|
title = child->app_id ? child->app_id : (child->class ? child->class : "(null)");
|
||||||
|
} else { //child->type == C_CONTAINER
|
||||||
title = generate_container_title(child);
|
title = generate_container_title(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!title) {
|
|
||||||
title = "(null)";
|
|
||||||
}
|
|
||||||
|
|
||||||
len = strlen(name) + strlen(title) + 1;
|
len = strlen(name) + strlen(title) + 1;
|
||||||
if (i < container->children->length-1) {
|
if (i < container->children->length-1) {
|
||||||
len++;
|
len++;
|
||||||
|
Loading…
Reference in New Issue
Block a user