[mutter] wayland/pointer-constraints: Maybe remove when pointer focus changes



commit e1516e4f31baf775e6a79d53d8739dd2bad89124
Author: Jonas Ådahl <jadahl gmail com>
Date:   Tue Sep 13 13:25:04 2016 +0800

    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 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-wayland-pointer-constraints.c b/src/wayland/meta-wayland-pointer-constraints.c
index 6d99c73..5cf74fc 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);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]