[mutter] wayland: Ensure we repick the pointer on synthesized crossing events
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] wayland: Ensure we repick the pointer on synthesized crossing events
- Date: Tue, 23 May 2017 15:10:58 +0000 (UTC)
commit 498200776c57aa25b35deecd56f43f28f53959e1
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Sep 17 16:13:31 2015 +0200
wayland: Ensure we repick the pointer on synthesized crossing events
Relayouts in clutter may trigger synthesized crossing events if the
actor below the pointer changes. In that situation we do need to
repick() the MetaWaylandPointer to end up with the right current
wayland surface.
https://bugzilla.gnome.org/show_bug.cgi?id=755164
src/wayland/meta-wayland-seat.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/src/wayland/meta-wayland-seat.c b/src/wayland/meta-wayland-seat.c
index 3404652..6858dcb 100644
--- a/src/wayland/meta-wayland-seat.c
+++ b/src/wayland/meta-wayland-seat.c
@@ -265,6 +265,18 @@ meta_wayland_seat_free (MetaWaylandSeat *seat)
}
static gboolean
+event_is_synthesized_crossing (const ClutterEvent *event)
+{
+ ClutterInputDevice *device;
+
+ if (event->type != CLUTTER_ENTER && event->type != CLUTTER_LEAVE)
+ return FALSE;
+
+ device = clutter_event_get_source_device (event);
+ return clutter_input_device_get_device_mode (device) == CLUTTER_INPUT_MODE_MASTER;
+}
+
+static gboolean
event_from_supported_hardware_device (MetaWaylandSeat *seat,
const ClutterEvent *event)
{
@@ -310,7 +322,8 @@ void
meta_wayland_seat_update (MetaWaylandSeat *seat,
const ClutterEvent *event)
{
- if (!event_from_supported_hardware_device (seat, event))
+ if (!event_from_supported_hardware_device (seat, event) &&
+ !event_is_synthesized_crossing (event))
return;
switch (event->type)
@@ -319,6 +332,8 @@ meta_wayland_seat_update (MetaWaylandSeat *seat,
case CLUTTER_BUTTON_PRESS:
case CLUTTER_BUTTON_RELEASE:
case CLUTTER_SCROLL:
+ case CLUTTER_ENTER:
+ case CLUTTER_LEAVE:
if (meta_wayland_seat_has_pointer (seat))
meta_wayland_pointer_update (seat->pointer, event);
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]