From 5db48faca408582706fbe07b570f64a879a515a7 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 24 Jul 2017 17:29:37 +0200 Subject: [PATCH] wayland: Update button state on motion/button events More specifically, avoid crossing events, since clutter does not set modifier/button state on those. Fixes implicit grabs being broken when the pointer moves past the surface boundaries. https://bugzilla.gnome.org/show_bug.cgi?id=785347 --- src/wayland/meta-wayland-pointer.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index 15e27cd39..d5c90c169 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -606,7 +606,12 @@ meta_wayland_pointer_update (MetaWaylandPointer *pointer, { repick_for_event (pointer, event); - pointer->button_count = count_buttons (event); + if (event->type == CLUTTER_MOTION || + event->type == CLUTTER_BUTTON_PRESS || + event->type == CLUTTER_BUTTON_RELEASE) + { + pointer->button_count = count_buttons (event); + } } static void