action: add "ShowMenu" option

Parse the following in rc.xml:

<keyboard>
  <keybind key="">
    <action name="ShowMenu">
      <menu>root-menu</menu>
    </action>
  </keybind>
</keyboard>
This commit is contained in:
Johan Malm 2020-10-31 15:27:22 +00:00
parent a26fd5a75b
commit 543f00131c
4 changed files with 28 additions and 9 deletions

View file

@ -267,13 +267,10 @@ cursor_button(struct wl_listener *listener, void *data)
/* handle _press_ on desktop */
if (!view) {
/* launch root-menu */
server->input_mode = LAB_INPUT_STATE_MENU;
menu_move(server->rootmenu, server->seat.cursor->x,
server->seat.cursor->y);
action(server, "ShowMenu", "root-menu");
return;
}
/* Handle _press_ on view */
desktop_focus_view(&server->seat, view);
switch (view_area) {