wayland/pointer: Don't set focus while during compositor grab

Teach the default grab about compositor grabs (i.e.
display->event_route) so that it can avoid setting a pointer focus when
after the compositor grab actively unset the pointer focus.

https://bugzilla.gnome.org/show_bug.cgi?id=772914
This commit is contained in:
Jonas Ådahl 2016-10-13 23:03:36 +08:00
parent 8b0e9706ca
commit b50da46f43

View File

@ -425,10 +425,24 @@ default_grab_focus (MetaWaylandPointerGrab *grab,
{
MetaWaylandPointer *pointer = grab->pointer;
MetaWaylandSeat *seat = meta_wayland_pointer_get_seat (pointer);
MetaDisplay *display = meta_get_display ();
if (pointer->button_count > 0)
return;
switch (display->event_route)
{
case META_EVENT_ROUTE_WINDOW_OP:
case META_EVENT_ROUTE_COMPOSITOR_GRAB:
case META_EVENT_ROUTE_FRAME_BUTTON:
return;
break;
case META_EVENT_ROUTE_NORMAL:
case META_EVENT_ROUTE_WAYLAND_POPUP:
break;
}
if (meta_wayland_seat_has_pointer (seat))
meta_wayland_pointer_set_focus (pointer, surface);
}