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.
This commit is contained in:
Droc 2024-09-18 12:08:10 -05:00 committed by Johan Malm
parent 71b2b5a4bc
commit d26b868dbe

View file

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