summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@blame.services>2021-09-06 20:32:36 +0200
committerDave Davenport <qball@blame.services>2021-09-06 20:32:36 +0200
commitc63e03fd49882c1d80f21461a99d429b122d0a08 (patch)
treede72075a1717b7365e77ec93a34f70864c5058c2
parent4d0eaf14631a0ef429cba002e63acc15fcfebc32 (diff)
[Window] Try to fix the autosizing of desktop name for non-i3 dekstop.
Issue: #1439
-rw-r--r--source/dialogs/window.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/source/dialogs/window.c b/source/dialogs/window.c
index fd393172..9ebdbeda 100644
--- a/source/dialogs/window.c
+++ b/source/dialogs/window.c
@@ -633,27 +633,31 @@ static void _window_mode_load_data(Mode *sw, unsigned int cd) {
g_free(output);
} else {
winclient->wmdesktopstr = g_strdup("Invalid name");
- pd->wmdn_len = MAX(pd->wmdn_len,
- g_utf8_strlen(winclient->wmdesktopstr, -1));
+ winclient->wmdesktopstr_len =
+ g_utf8_strlen(winclient->wmdesktopstr, -1);
+ pd->wmdn_len = MAX(pd->wmdn_len, winclient->wmdesktopstr_len);
}
} else {
winclient->wmdesktopstr = g_markup_escape_text(
_window_name_list_entry(names.strings, names.strings_len,
winclient->wmdesktop),
-1);
- pd->wmdn_len =
- MAX(pd->wmdn_len, g_utf8_strlen(winclient->wmdesktopstr, -1));
+ winclient->wmdesktopstr_len =
+ g_utf8_strlen(winclient->wmdesktopstr, -1);
+ pd->wmdn_len = MAX(pd->wmdn_len, winclient->wmdesktopstr_len);
}
} else {
winclient->wmdesktopstr =
g_strdup_printf("%u", (uint32_t)winclient->wmdesktop);
- pd->wmdn_len =
- MAX(pd->wmdn_len, g_utf8_strlen(winclient->wmdesktopstr, -1));
+ winclient->wmdesktopstr_len =
+ g_utf8_strlen(winclient->wmdesktopstr, -1);
+ pd->wmdn_len = MAX(pd->wmdn_len, winclient->wmdesktopstr_len);
}
} else {
winclient->wmdesktopstr = g_strdup("");
- pd->wmdn_len =
- MAX(pd->wmdn_len, g_utf8_strlen(winclient->wmdesktopstr, -1));
+ winclient->wmdesktopstr_len =
+ g_utf8_strlen(winclient->wmdesktopstr, -1);
+ pd->wmdn_len = MAX(pd->wmdn_len, winclient->wmdesktopstr_len);
}
if (cd && winclient->wmdesktop != current_desktop) {
continue;