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
This commit is contained in:
Carlos Garnacho 2015-09-17 16:13:31 +02:00
parent 27b949d6ba
commit 498200776c

View File

@ -264,6 +264,18 @@ meta_wayland_seat_free (MetaWaylandSeat *seat)
g_slice_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;