[weston,4/6] window: Call the menu callback even if the menu was dismissed

Submitted by Dima Ryazanov on Dec. 5, 2016, 3:36 a.m.

Details

Message ID 20161205033635.20086-5-dima@gmail.com
State New
Headers show
Series "Implement xdg-shell's show_window_menu API" ( rev: 1 ) in Wayland

Not browsing as part of any series.

Commit Message

Dima Ryazanov Dec. 5, 2016, 3:36 a.m.
Desktop shell will need to know when to clean up menu-related resources.
Other clients might find it useful, too.

Signed-off-by: Dima Ryazanov <dima@gmail.com>
---
 clients/window.c | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/clients/window.c b/clients/window.c
index f49ce72..12884f4 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -5359,6 +5359,7 @@  menu_touch_up_handler(struct widget *widget,
 {
 	struct menu *menu = data;
 
+	menu->func(menu->user_data, input, -1);
 	input_ungrab(input);
 	menu_destroy(menu);
 }
@@ -5419,6 +5420,7 @@  xdg_popup_handle_popup_done(void *data, struct zxdg_popup_v6 *xdg_popup)
 	struct window *window = data;
 	struct menu *menu = window->main_surface->widget->user_data;
 
+	menu->func(menu->user_data, menu->input, -1);
 	input_ungrab(menu->input);
 	menu_destroy(menu);
 }