diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2017-10-09 14:49:10 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2017-10-26 12:53:20 +0200 |
commit | 01de04d8c91b1be142e06b2203589bfcd9b52e93 (patch) | |
tree | 549b00a69afb587805f4e2ae67aaf11d3e5a3f6d /src | |
parent | 08e4cb54a80cdbaf01ee1bb7120a8f5dba6e1547 (diff) | |
download | mutter-01de04d8c91b1be142e06b2203589bfcd9b52e93.tar.gz |
wayland: Update pointer confinement on surface actor relocations
In the unlikely case that a surface is moved by the compositor while
holding a pointer confinement, we also need to update the pointer
position when the surface actor gets moved.
https://bugzilla.gnome.org/show_bug.cgi?id=782344
Diffstat (limited to 'src')
-rw-r--r-- | src/wayland/meta-pointer-confinement-wayland.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/wayland/meta-pointer-confinement-wayland.c b/src/wayland/meta-pointer-confinement-wayland.c index 8f41db5ba..65a85c47b 100644 --- a/src/wayland/meta-pointer-confinement-wayland.c +++ b/src/wayland/meta-pointer-confinement-wayland.c @@ -671,6 +671,21 @@ surface_actor_allocation_notify (MetaSurfaceActorWayland *surface_actor, meta_pointer_confinement_wayland_maybe_warp (self); } +static void +surface_actor_position_notify (MetaSurfaceActorWayland *surface_actor, + GParamSpec *pspec, + MetaPointerConfinementWayland *self) +{ + meta_pointer_confinement_wayland_maybe_warp (self); +} + +static void +window_position_changed (MetaWindow *window, + MetaPointerConfinementWayland *self) +{ + meta_pointer_confinement_wayland_maybe_warp (self); +} + MetaPointerConstraint * meta_pointer_confinement_wayland_new (MetaWaylandPointerConstraint *constraint) { @@ -689,6 +704,19 @@ meta_pointer_confinement_wayland_new (MetaWaylandPointerConstraint *constraint) G_CALLBACK (surface_actor_allocation_notify), confinement, 0); + g_signal_connect_object (surface->surface_actor, + "notify::position", + G_CALLBACK (surface_actor_position_notify), + confinement, + 0); + if (surface->window) + { + g_signal_connect_object (surface->window, + "position-changed", + G_CALLBACK (window_position_changed), + confinement, + 0); + } return META_POINTER_CONSTRAINT (confinement); } |