summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2021-01-19 15:22:51 +0100
committerDaniel Stone <daniels@collabora.com>2023-03-31 12:10:26 +0000
commit14fc87cc42d58164f152c824a5c745ac19fd74be (patch)
tree0cf33369e731b5c2cdcad62a399b8f48122c845c
parent6d3d98851e2f7eb6a2fae8ada77eca717e9ca12a (diff)
downloadweston-14fc87cc42d58164f152c824a5c745ac19fd74be.tar.gz
clients/window: dismiss window on tablet tool up events
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--clients/window.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/clients/window.c b/clients/window.c
index 1a26e5c6..f8bcd4d7 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -5355,6 +5355,16 @@ menu_touch_up_handler(struct widget *widget,
}
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)
{
cairo_t *cr;
@@ -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);