mirror of
https://github.com/labwc/labwc.git
synced 2026-02-16 22:05:27 -05:00
src/menu: Attach view to menu and use it when executing actions
This fixes #380
This commit is contained in:
parent
ca9226a7a6
commit
5a4c5de332
5 changed files with 63 additions and 30 deletions
19
src/cursor.c
19
src/cursor.c
|
|
@ -718,13 +718,8 @@ cursor_button(struct wl_listener *listener, void *data)
|
|||
seat->pressed.surface = NULL;
|
||||
if (server->input_mode == LAB_INPUT_STATE_MENU) {
|
||||
if (close_menu) {
|
||||
if (server->menu_current) {
|
||||
menu_close(server->menu_current);
|
||||
server->menu_current = NULL;
|
||||
}
|
||||
server->input_mode = LAB_INPUT_STATE_PASSTHROUGH;
|
||||
cursor_rebase(&server->seat,
|
||||
event->time_msec, false);
|
||||
menu_close_root(server);
|
||||
cursor_rebase(&server->seat, event->time_msec, false);
|
||||
close_menu = false;
|
||||
}
|
||||
return;
|
||||
|
|
@ -755,17 +750,11 @@ cursor_button(struct wl_listener *listener, void *data)
|
|||
}
|
||||
|
||||
if (server->input_mode == LAB_INPUT_STATE_MENU) {
|
||||
/* We are closing the menu on RELEASE to not leak a stray release */
|
||||
if (view_area != LAB_SSD_MENU) {
|
||||
/*
|
||||
* We close the menu on release so we don't leak a stray
|
||||
* release
|
||||
*/
|
||||
close_menu = true;
|
||||
} else if (menu_call_actions(node)) {
|
||||
/*
|
||||
* Action was successfull, may fail if item just opens a
|
||||
* submenu
|
||||
*/
|
||||
/* Action was successfull, may fail if item just opens a submenu */
|
||||
close_menu = true;
|
||||
}
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue