[mutter] wayland: Use notify::allocation to update pointer as per confinements



commit 27ea62a79d9de0cfde3243299a193185d11ede53
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue May 9 12:27:52 2017 +0200

    wayland: Use notify::allocation to update pointer as per confinements
    
    There is no need to constraint the pointer to the confinement on each redraw
    if the surface actor didn't move/resize.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=782344

 src/wayland/meta-pointer-confinement-wayland.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/wayland/meta-pointer-confinement-wayland.c b/src/wayland/meta-pointer-confinement-wayland.c
index 293200c..8f41db5 100644
--- a/src/wayland/meta-pointer-confinement-wayland.c
+++ b/src/wayland/meta-pointer-confinement-wayland.c
@@ -664,8 +664,9 @@ meta_pointer_confinement_wayland_maybe_warp (MetaPointerConfinementWayland *self
 }
 
 static void
-surface_actor_painting (MetaSurfaceActorWayland       *surface_actor,
-                        MetaPointerConfinementWayland *self)
+surface_actor_allocation_notify (MetaSurfaceActorWayland       *surface_actor,
+                                 GParamSpec                    *pspec,
+                                 MetaPointerConfinementWayland *self)
 {
   meta_pointer_confinement_wayland_maybe_warp (self);
 }
@@ -684,8 +685,8 @@ meta_pointer_confinement_wayland_new (MetaWaylandPointerConstraint *constraint)
 
   surface = meta_wayland_pointer_constraint_get_surface (constraint);
   g_signal_connect_object (surface->surface_actor,
-                           "painting",
-                           G_CALLBACK (surface_actor_painting),
+                           "notify::allocation",
+                           G_CALLBACK (surface_actor_allocation_notify),
                            confinement,
                            0);
 


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