]> git.mdlowis.com Git - proto/labwc.git/commitdiff
menu: don't fill default items in empty menus
authortokyo4j <hrak1529@gmail.com>
Mon, 10 Mar 2025 07:49:35 +0000 (16:49 +0900)
committerJohan Malm <johanmalm@users.noreply.github.com>
Mon, 10 Mar 2025 19:42:03 +0000 (19:42 +0000)
This is needed to prevent pipemenus which usually contains no items
from being filled with default items in follow-up commits.

src/menu/menu.c

index 8139063cb12410c1cea0d91f89841304bdfba35b..f2de6609838b0608b216083c57a63147554d553c 100644 (file)
@@ -1085,8 +1085,6 @@ init_rootmenu(struct server *server)
        if (!menu) {
                current_menu = NULL;
                menu = menu_create(server, "root-menu", "");
-       }
-       if (wl_list_empty(&menu->menuitems)) {
                current_item = item_create(menu, _("Reconfigure"), false);
                fill_item("name.action", "Reconfigure");
                current_item = item_create(menu, _("Exit"), false);
@@ -1103,8 +1101,6 @@ init_windowmenu(struct server *server)
        if (!menu) {
                current_menu = NULL;
                menu = menu_create(server, "client-menu", "");
-       }
-       if (wl_list_empty(&menu->menuitems)) {
                current_item = item_create(menu, _("Minimize"), false);
                fill_item("name.action", "Iconify");
                current_item = item_create(menu, _("Maximize"), false);