From d26b868dbed04dad5f814cad4df9747a5d13edbb Mon Sep 17 00:00:00 2001 From: Droc Date: Wed, 18 Sep 2024 12:08:10 -0500 Subject: [PATCH] client list combined menu fix We don't know if the client-list-combined-menu is standalone ie. triggered by a keybind or a submenu of another menu. So we update client-list-combined-menu every time ShowMenu is called. --- src/action.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/action.c b/src/action.c index 493ba734..67067ad3 100644 --- a/src/action.c +++ b/src/action.c @@ -665,10 +665,15 @@ show_menu(struct server *server, struct view *view, return; } - /* Need to refresh to show current windows and recalculate width */ - if (!strcasecmp(menu_name, "client-list-combined-menu")) { - update_client_list_combined_menu(menu->server); - } + /* + * We always refresh the client-list-combined-menu so that it is + * up-to-date whether it is used as a menu with `menu_name` set to + * `client-list-combined-menu` * or used as a submenu + * which we don't know at this point. It is also needed to calculate + * the proper width for placemeent, as it fluctuates depending + * on the length of the title. + */ + update_client_list_combined_menu(menu->server); int x = server->seat.cursor->x; int y = server->seat.cursor->y;