]> git.mdlowis.com Git - proto/labwc.git/commitdiff
workspaces: Add default workspace sub menu
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Wed, 15 Jun 2022 00:02:15 +0000 (02:02 +0200)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Wed, 15 Jun 2022 20:26:21 +0000 (22:26 +0200)
docs/menu.xml
src/menu/menu.c

index 485077d0b88fad2d3b1b1ced1e1e74af87231407..b61dd85adebd71dbfec5657d5bfb0ef92b154b7a 100644 (file)
        <item label="AlwaysOnTop">
                <action name="ToggleAlwaysOnTop" />
        </item>
+       <menu id="workspaces" label="Workspace">
+               <item label="Move left">
+                       <action name="SendToDesktop" to="left" />
+                       <action name="GoToDesktop" to="left" />
+               </item>
+               <item label="Move right">
+                       <action name="SendToDesktop" to="right" />
+                       <action name="GoToDesktop" to="right" />
+               </item>
+       </menu>
        <item label="Close">
                <action name="Close" />
        </item>
index 1ccf0c495f875df2b59e3ea484c6d56d7941b702..85dc976468bbd71ba22b67afb2c2cf337686ba04 100644 (file)
@@ -489,6 +489,22 @@ menu_init_windowmenu(struct server *server)
                fill_item("name.action", "ToggleDecorations");
                current_item = item_create(menu, _("AlwaysOnTop"));
                fill_item("name.action", "ToggleAlwaysOnTop");
+
+               /* Workspace sub-menu */
+               struct menu *workspace_menu = menu_create(server, "workspaces", "");
+               current_item = item_create(workspace_menu, _("Move left"));
+               fill_item("name.action", "SendToDesktop");
+               fill_item("to.action", "left");
+               fill_item("name.action", "GoToDesktop");
+               fill_item("to.action", "left");
+               current_item = item_create(workspace_menu, _("Move right"));
+               fill_item("name.action", "SendToDesktop");
+               fill_item("to.action", "right");
+               fill_item("name.action", "GoToDesktop");
+               fill_item("to.action", "right");
+               current_item = item_create(menu, _("Workspace"));
+               current_item->submenu = workspace_menu;
+
                current_item = item_create(menu, _("Close"));
                fill_item("name.action", "Close");
        }