summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2023-01-08 12:23:24 +0100
committerDave Davenport <qball@gmpclient.org>2023-01-08 12:23:24 +0100
commitbe4eeda3a5445054ffa30043b62ce8b974c318c8 (patch)
tree504705593f621621566962ded5d56ddfb298ace5
parent9fda280be1f7416672740b382203342f16328464 (diff)
[window] When no window title set, handle this more gracefully
-rw-r--r--source/modes/window.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/modes/window.c b/source/modes/window.c
index 1ff3a98d..0ac58325 100644
--- a/source/modes/window.c
+++ b/source/modes/window.c
@@ -356,7 +356,11 @@ static client *window_client(WindowModePrivateData *pd, xcb_window_t win) {
if (tmp_title == NULL) {
tmp_title = window_get_text_prop(c->window, XCB_ATOM_WM_NAME);
}
- c->title = g_markup_escape_text(tmp_title, -1);
+ if ( tmp_title != NULL ) {
+ c->title = g_markup_escape_text(tmp_title, -1);
+ } else {
+ c->title = g_strdup("<i>no title set</i>");
+ }
pd->title_len =
MAX(c->title ? g_utf8_strlen(c->title, -1) : 0, pd->title_len);
g_free(tmp_title);