wayland/pointer-constraints: Maybe remove when pointer focus changes

Also maybe remove a constraint when the pointer focus changes. This is
needed because when Xwayland has a constraint focus may change, the
constraint object will not receive a 'appears-focused' event on its
window since it never changed.

This happens for example when an override-redirect window (which never
appears focused) holds the constraint, and alt-tab happens. In this case
focus changes, but from the constraint's point of view, none of the
windows it knows about changed its focus appearance.

https://bugzilla.gnome.org/show_bug.cgi?id=771345
This commit is contained in:
Jonas Ådahl 2016-09-13 13:25:04 +08:00
parent 32276cf418
commit e1516e4f31

View File

@ -279,6 +279,15 @@ static void
pointer_focus_surface_changed (MetaWaylandPointer *pointer,
MetaWaylandPointerConstraint *constraint)
{
MetaWindow *window = constraint->surface->window;
if (window)
{
MetaWaylandSeat *seat = meta_wayland_pointer_get_seat (pointer);
meta_wayland_pointer_constraint_maybe_remove_for_seat (seat, window);
}
meta_wayland_pointer_constraint_maybe_enable (constraint);
}