diff options
author | D.B <thejan.2009@gmail.com> | 2016-08-07 08:32:37 +0200 |
---|---|---|
committer | D.B <thejan.2009@gmail.com> | 2016-08-07 08:37:26 +0200 |
commit | 9c91952aecdd6935d343fd944e320d67f011c7f0 (patch) | |
tree | 9c48568dadb767ea6da1efbb87ba930e6d06ac07 | |
parent | Merge pull request #840 from minus7/man-inputs (diff) | |
download | sway-9c91952aecdd6935d343fd944e320d67f011c7f0.tar.gz sway-9c91952aecdd6935d343fd944e320d67f011c7f0.tar.zst sway-9c91952aecdd6935d343fd944e320d67f011c7f0.zip |
Display class in tab title if app_id is null
This is a feature that can't work the same as i3, because there is no
real window classes in wayland. This way, we avoid null titles as much
as possible.
-rw-r--r-- | sway/border.c | 10 |
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) { | |||
228 | for (i = 0; i < container->children->length; ++i) { | 228 | for (i = 0; i < container->children->length; ++i) { |
229 | prev_name = name; | 229 | prev_name = name; |
230 | swayc_t* child = container->children->items[i]; | 230 | swayc_t* child = container->children->items[i]; |
231 | const char *title = child->app_id; | 231 | const char *title = NULL; |
232 | if (child->type == C_CONTAINER) { | 232 | if (child->type == C_VIEW) { |
233 | title = child->app_id ? child->app_id : (child->class ? child->class : "(null)"); | ||
234 | } else { //child->type == C_CONTAINER | ||
233 | title = generate_container_title(child); | 235 | title = generate_container_title(child); |
234 | } | 236 | } |
235 | 237 | ||
236 | if (!title) { | ||
237 | title = "(null)"; | ||
238 | } | ||
239 | |||
240 | len = strlen(name) + strlen(title) + 1; | 238 | len = strlen(name) + strlen(title) + 1; |
241 | if (i < container->children->length-1) { | 239 | if (i < container->children->length-1) { |
242 | len++; | 240 | len++; |