1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

[window] When no window title set, handle this more gracefully

This commit is contained in:
Dave Davenport 2023-01-08 12:23:24 +01:00
parent 9fda280be1
commit be4eeda3a5

View file

@ -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);