]> git.mdlowis.com Git - proto/labwc.git/commitdiff
client list combined menu fix
authorDroc <japhack@yahoo.com>
Wed, 18 Sep 2024 17:08:10 +0000 (12:08 -0500)
committerJohan Malm <johanmalm@users.noreply.github.com>
Wed, 18 Sep 2024 21:07:41 +0000 (22:07 +0100)
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

index 493ba73484989f17abf13f8f0ad0fad741ee8a91..67067ad32c60fb1817e85314a703561af1c3e09f 100644 (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;