diff --git a/src/wayland/meta-pointer-confinement-wayland.c b/src/wayland/meta-pointer-confinement-wayland.c index 01a2b7ff8..1e95c1f0d 100644 --- a/src/wayland/meta-pointer-confinement-wayland.c +++ b/src/wayland/meta-pointer-confinement-wayland.c @@ -664,17 +664,8 @@ meta_pointer_confinement_wayland_maybe_warp (MetaPointerConfinementWayland *self } static void -surface_actor_allocation_notify (MetaSurfaceActorWayland *surface_actor, - GParamSpec *pspec, - MetaPointerConfinementWayland *self) -{ - meta_pointer_confinement_wayland_maybe_warp (self); -} - -static void -surface_actor_position_notify (MetaSurfaceActorWayland *surface_actor, - GParamSpec *pspec, - MetaPointerConfinementWayland *self) +surface_actor_geometry_changed (MetaSurfaceActorWayland *surface_actor, + MetaPointerConfinementWayland *self) { meta_pointer_confinement_wayland_maybe_warp (self); } @@ -700,13 +691,8 @@ meta_pointer_confinement_wayland_new (MetaWaylandPointerConstraint *constraint) surface = meta_wayland_pointer_constraint_get_surface (constraint); g_signal_connect_object (meta_wayland_surface_get_actor (surface), - "notify::allocation", - G_CALLBACK (surface_actor_allocation_notify), - confinement, - 0); - g_signal_connect_object (meta_wayland_surface_get_actor (surface), - "notify::position", - G_CALLBACK (surface_actor_position_notify), + "geometry-changed", + G_CALLBACK (surface_actor_geometry_changed), confinement, 0); if (surface->window) diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index fe7f59d78..41ad8bc2b 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -105,6 +105,7 @@ enum { SURFACE_CONFIGURE, SURFACE_SHORTCUTS_INHIBITED, SURFACE_SHORTCUTS_RESTORED, + SURFACE_GEOMETRY_CHANGED, N_SURFACE_SIGNALS }; @@ -1237,7 +1238,7 @@ surface_actor_mapped_notify (MetaSurfaceActorWayland *surface_actor, GParamSpec *pspec, MetaWaylandSurface *surface) { - meta_wayland_surface_update_outputs_recursively (surface); + g_signal_emit (surface, surface_signals[SURFACE_GEOMETRY_CHANGED], 0); } static void @@ -1245,7 +1246,7 @@ surface_actor_allocation_notify (MetaSurfaceActorWayland *surface_actor, GParamSpec *pspec, MetaWaylandSurface *surface) { - meta_wayland_surface_update_outputs_recursively (surface); + g_signal_emit (surface, surface_signals[SURFACE_GEOMETRY_CHANGED], 0); } static void @@ -1253,7 +1254,7 @@ surface_actor_position_notify (MetaSurfaceActorWayland *surface_actor, GParamSpec *pspec, MetaWaylandSurface *surface) { - meta_wayland_surface_update_outputs_recursively (surface); + g_signal_emit (surface, surface_signals[SURFACE_GEOMETRY_CHANGED], 0); } static void @@ -1536,6 +1537,10 @@ static void meta_wayland_surface_init (MetaWaylandSurface *surface) { surface->pending = g_object_new (META_TYPE_WAYLAND_PENDING_STATE, NULL); + + g_signal_connect (surface, "geometry-changed", + G_CALLBACK (meta_wayland_surface_update_outputs_recursively), + NULL); } static void @@ -1582,6 +1587,13 @@ meta_wayland_surface_class_init (MetaWaylandSurfaceClass *klass) 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + surface_signals[SURFACE_GEOMETRY_CHANGED] = + g_signal_new ("geometry-changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + 0, NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); } static void @@ -1795,3 +1807,9 @@ meta_wayland_surface_get_actor (MetaWaylandSurface *surface) { return surface->surface_actor; } + +void +meta_wayland_surface_notify_geometry_changed (MetaWaylandSurface *surface) +{ + g_signal_emit (surface, surface_signals[SURFACE_GEOMETRY_CHANGED], 0); +} diff --git a/src/wayland/meta-wayland-surface.h b/src/wayland/meta-wayland-surface.h index ec0b011ac..92ce1050a 100644 --- a/src/wayland/meta-wayland-surface.h +++ b/src/wayland/meta-wayland-surface.h @@ -305,4 +305,6 @@ gboolean meta_wayland_surface_is_shortcuts_inhibited (MetaWaylandSurf MetaSurfaceActor * meta_wayland_surface_get_actor (MetaWaylandSurface *surface); +void meta_wayland_surface_notify_geometry_changed (MetaWaylandSurface *surface); + #endif