From 27ea62a79d9de0cfde3243299a193185d11ede53 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 9 May 2017 12:27:52 +0200 Subject: [PATCH] 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 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/wayland/meta-pointer-confinement-wayland.c b/src/wayland/meta-pointer-confinement-wayland.c index 293200ca8..8f41db5ba 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);