sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 9c91952aecdd6935d343fd944e320d67f011c7f0
parent aca9f6b2a26f0924a99dfd5bb2532bac484b88a0
Author: D.B <thejan.2009@gmail.com>
Date:   Sun,  7 Aug 2016 08:32:37 +0200

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.

Diffstat:
Msway/border.c | 10++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git 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++;