From 367811be2d285452bbeecd94bf69bae20ee8221d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ingo=20B=C3=BCrk?= Date: Mon, 16 Jan 2017 23:00:01 +0100 Subject: [PATCH] Ensure that marks and the title are displayed even if the window title is empty. (#2639) Previously rendering marks and the title were skipped if the title is empty. With marks this is obviously wrong, with the title it is also wrong because title_format might be set. --- src/x.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/x.c b/src/x.c index f3dbc237..d9a70a92 100644 --- a/src/x.c +++ b/src/x.c @@ -572,9 +572,6 @@ void x_draw_decoration(Con *con) { goto after_title; } - if (win->name == NULL) - goto copy_pixmaps; - int mark_width = 0; if (config.show_marks && !TAILQ_EMPTY(&(con->marks_head))) { char *formatted_mark = sstrdup(""); @@ -608,13 +605,19 @@ void x_draw_decoration(Con *con) { } i3String *title = con->title_format == NULL ? win->name : con_parse_title_format(con); + if (title == NULL) { + goto copy_pixmaps; + } + draw_util_text(title, &(parent->frame_buffer), p->color->text, p->color->background, con->deco_rect.x + logical_px(2), con->deco_rect.y + text_offset_y, con->deco_rect.width - mark_width - 2 * logical_px(2)); - if (con->title_format != NULL) + + if (con->title_format != NULL) { I3STRING_FREE(title); + } after_title: x_draw_decoration_after_title(con, p); -- 2.39.5