exposay: provide a cancel func to the ptr grab iface
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Tue, 26 Nov 2013 12:32:08 +0000 (13:32 +0100)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 28 Nov 2013 06:49:31 +0000 (22:49 -0800)
Fixes a crash when cancel is called while exposay is in progress.

src/shell.c

index f102e9a..6ba1f10 100644 (file)
@@ -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