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
This commit is contained in:
parent
d9ea3ceabe
commit
b7fc6480dd
@ -671,6 +671,21 @@ surface_actor_allocation_notify (MetaSurfaceActorWayland *surface_actor,
|
|||||||
meta_pointer_confinement_wayland_maybe_warp (self);
|
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 *
|
MetaPointerConstraint *
|
||||||
meta_pointer_confinement_wayland_new (MetaWaylandPointerConstraint *constraint)
|
meta_pointer_confinement_wayland_new (MetaWaylandPointerConstraint *constraint)
|
||||||
{
|
{
|
||||||
@ -689,6 +704,19 @@ meta_pointer_confinement_wayland_new (MetaWaylandPointerConstraint *constraint)
|
|||||||
G_CALLBACK (surface_actor_allocation_notify),
|
G_CALLBACK (surface_actor_allocation_notify),
|
||||||
confinement,
|
confinement,
|
||||||
0);
|
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);
|
return META_POINTER_CONSTRAINT (confinement);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user