wayland: Don't cancel the pointer grab on compositor grabs

We shouldn't cancel the pointer grab when there is a compositor grab,
since that'd break things like drag-n-drop via the overview and
alt-tabs.

The original reason for cancelling the pointer grab on compositor grabs
was to avoid a re-entry when a compositor grab was activated while
there was an active pointer constraint grab. The re-entry would happen
when the compositor grab cleared the pointer focus. Clearing the focus
would trigger the pointer constraint to be deactivated, which would end
its grab. Ending the grab would reset the grab to the default one, which
could focus the same surface again, triggering the constraint to
re-enable before it finished disabling.

This is now avoided because the default grab handler is now aware of
compositor grabs, and won't override the cleared pointer focus until
the compositor grab ends.

https://bugzilla.gnome.org/show_bug.cgi?id=772914
This commit is contained in:
Jonas Ådahl 2016-10-13 23:05:39 +08:00
parent 84134aa78e
commit d911c5aac4

View File

@ -229,8 +229,6 @@ sync_focus_surface (MetaWaylandPointer *pointer)
case META_EVENT_ROUTE_COMPOSITOR_GRAB: case META_EVENT_ROUTE_COMPOSITOR_GRAB:
case META_EVENT_ROUTE_FRAME_BUTTON: case META_EVENT_ROUTE_FRAME_BUTTON:
/* The compositor has a grab, so remove our focus... */ /* The compositor has a grab, so remove our focus... */
meta_wayland_pointer_cancel_grab (pointer);
meta_wayland_pointer_reset_grab (pointer);
meta_wayland_pointer_set_focus (pointer, NULL); meta_wayland_pointer_set_focus (pointer, NULL);
break; break;