From 14fc87cc42d58164f152c824a5c745ac19fd74be Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Tue, 19 Jan 2021 15:22:51 +0100 Subject: [PATCH] clients/window: dismiss window on tablet tool up events Signed-off-by: Michael Olbrich --- clients/window.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/clients/window.c b/clients/window.c index 1a26e5c6..f8bcd4d7 100644 --- a/clients/window.c +++ b/clients/window.c @@ -5354,6 +5354,16 @@ menu_touch_up_handler(struct widget *widget, menu_destroy(menu); } +static void +menu_tablet_tool_up_handler(struct widget *widget, struct tablet_tool *tool, + void *data) +{ + struct menu *menu = data; + + input_ungrab(tool->input); + menu_destroy(menu); +} + static void menu_redraw_handler(struct widget *widget, void *data) { @@ -5460,6 +5470,7 @@ create_menu(struct display *display, widget_set_motion_handler(menu->widget, menu_motion_handler); widget_set_button_handler(menu->widget, menu_button_handler); widget_set_touch_up_handler(menu->widget, menu_touch_up_handler); + widget_set_tablet_tool_up_handler(menu->widget, menu_tablet_tool_up_handler); input_grab(input, menu->widget, 0); frame_resize_inside(menu->frame, 200, count * 20);