[PATCH] exposay: provide a cancel func to the ptr grab iface

pochu27 at gmail.com pochu27 at gmail.com
Tue Nov 26 04:32:08 PST 2013


From: Emilio Pozuelo Monfort <emilio.pozuelo at collabora.co.uk>

Fixes a crash when cancel is called while exposay is in progress.
---
 src/shell.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/shell.c b/src/shell.c
index f102e9a..6ba1f10 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -5275,10 +5275,20 @@ exposay_button(struct weston_pointer_grab *grab, uint32_t time, uint32_t button,
 		shell->exposay.clicked = NULL;
 }
 
+static void
+exposay_pointer_grab_cancel(struct weston_pointer_grab *grab)
+{
+	struct desktop_shell *shell =
+		container_of(grab, struct desktop_shell, exposay.grab_ptr);
+
+	exposay_set_state(shell, EXPOSAY_TARGET_CANCEL, shell->exposay.seat);
+}
+
 static const struct weston_pointer_grab_interface exposay_ptr_grab = {
 	noop_grab_focus,
 	exposay_motion,
 	exposay_button,
+	exposay_pointer_grab_cancel,
 };
 
 static int
-- 
1.8.4.rc3



More information about the wayland-devel mailing list