diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2022-12-18 09:56:41 +0100 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2022-12-18 10:00:14 +0100 |
commit | 2762a6700004ce50fcbbbc2a9fb4a62383dcd9f0 (patch) | |
tree | dbee7fd7b013dca443c0b11697bf630627d4012a | |
parent | 439856e7aae82a9b237cae4c548e1352456db8bf (diff) | |
download | mutter-2762a6700004ce50fcbbbc2a9fb4a62383dcd9f0.tar.gz |
pointer-lock/wayland: Get compositor from surface
This avoids trying to get it from an pointer that was never set to
anything.
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2558
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2772>
-rw-r--r-- | src/wayland/meta-pointer-lock-wayland.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wayland/meta-pointer-lock-wayland.c b/src/wayland/meta-pointer-lock-wayland.c index 617ef7880..30074903c 100644 --- a/src/wayland/meta-pointer-lock-wayland.c +++ b/src/wayland/meta-pointer-lock-wayland.c @@ -52,17 +52,17 @@ G_DEFINE_TYPE (MetaPointerLockWayland, meta_pointer_lock_wayland, static MetaPointerConstraint * meta_pointer_lock_wayland_create_constraint (MetaPointerConfinementWayland *confinement) { - MetaPointerLockWayland *lock_wayland = META_POINTER_LOCK_WAYLAND (confinement); - MetaWaylandCompositor *compositor = - meta_wayland_pointer_constraint_get_compositor (lock_wayland->constraint); + MetaWaylandPointerConstraint *wayland_constraint = + meta_pointer_confinement_wayland_get_wayland_pointer_constraint (confinement); + MetaWaylandSurface *surface = + meta_wayland_pointer_constraint_get_surface (wayland_constraint); + MetaWaylandCompositor *compositor = surface->compositor; MetaContext *context = meta_wayland_compositor_get_context (compositor); MetaBackend *backend = meta_context_get_backend (context); ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend); ClutterSeat *seat = clutter_backend_get_default_seat (clutter_backend); ClutterInputDevice *pointer = clutter_seat_get_pointer (seat); - MetaWaylandPointerConstraint *wayland_constraint; MetaPointerConstraint *constraint; - MetaWaylandSurface *surface; graphene_point_t point; cairo_region_t *region; float sx, sy, x, y; |