From e1516e4f31baf775e6a79d53d8739dd2bad89124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 13 Sep 2016 13:25:04 +0800 Subject: [PATCH] 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 --- src/wayland/meta-wayland-pointer-constraints.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/wayland/meta-wayland-pointer-constraints.c b/src/wayland/meta-wayland-pointer-constraints.c index 6d99c73f2..5cf74fcd4 100644 --- a/src/wayland/meta-wayland-pointer-constraints.c +++ b/src/wayland/meta-wayland-pointer-constraints.c @@ -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); }