mirror of
https://github.com/labwc/labwc.git
synced 2025-11-05 13:29:58 -05:00
menu: run actions on button release
...and call actions after closing menus so that virtual keyboard input caused by actions are sent to the surface with keyboard-focus rather than being consumed by the open menu. Fixes: #1366
This commit is contained in:
parent
cc8f4f943a
commit
e9023f51c6
3 changed files with 24 additions and 17 deletions
|
|
@ -931,9 +931,6 @@ menu_execute_item(struct menuitem *item)
|
|||
return false;
|
||||
}
|
||||
|
||||
actions_run(item->parent->triggered_by_view,
|
||||
item->parent->server, &item->actions, 0);
|
||||
|
||||
/*
|
||||
* We close the menu here to provide a faster feedback to the user.
|
||||
* We do that without resetting the input state so src/cursor.c
|
||||
|
|
@ -942,6 +939,17 @@ menu_execute_item(struct menuitem *item)
|
|||
menu_close(item->parent->server->menu_current);
|
||||
item->parent->server->menu_current = NULL;
|
||||
|
||||
struct server *server = item->parent->server;
|
||||
menu_close_root(server);
|
||||
cursor_update_focus(server);
|
||||
|
||||
/*
|
||||
* We call the actions after menu_close_root() so that virtual keyboard
|
||||
* input is sent to the focused_surface instead of being absorbed by the
|
||||
* menu. Consider for example: `wlrctl keyboard type abc`
|
||||
*/
|
||||
actions_run(item->parent->triggered_by_view, server, &item->actions, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue