aboutsummaryrefslogtreecommitdiff
path: root/sway/border.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2016-08-07 02:52:45 -0400
committerGitHub <noreply@github.com>2016-08-07 02:52:45 -0400
commite8ca63702ef370d968cc3bc3a420698ee13c876e (patch)
tree9c48568dadb767ea6da1efbb87ba930e6d06ac07 /sway/border.c
parentaca9f6b2a26f0924a99dfd5bb2532bac484b88a0 (diff)
parent9c91952aecdd6935d343fd944e320d67f011c7f0 (diff)
Merge pull request #841 from thejan2009/tabbed-title-avoiding-null
Display class in container title if app_id is null
Diffstat (limited to 'sway/border.c')
-rw-r--r--sway/border.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sway/border.c b/sway/border.c
index 304f8b87..0d3cfab8 100644
--- a/sway/border.c
+++ b/sway/border.c
@@ -228,15 +228,13 @@ static char *generate_container_title(swayc_t *container) {
for (i = 0; i < container->children->length; ++i) {
prev_name = name;
swayc_t* child = container->children->items[i];
- const char *title = child->app_id;
- if (child->type == C_CONTAINER) {
+ const char *title = NULL;
+ 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);
}
- if (!title) {
- title = "(null)";
- }
-
len = strlen(name) + strlen(title) + 1;
if (i < container->children->length-1) {
len++;