1
0
Fork 0

wayland/pointer-constraints: Don't steal regions for new constraints

meta_pointer_constraint_new() does not take ownership of the passed
regions but instead creates a copy, resulting in a leak in the calling
functions.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3749>
(cherry picked from commit 650ef9b57f)
This commit is contained in:
Sebastian Keller 2024-05-12 23:22:08 +02:00 committed by Jonas Ådahl
parent e466a1bccc
commit 5a5a506f57
2 changed files with 2 additions and 2 deletions

View file

@ -247,7 +247,7 @@ meta_pointer_confinement_wayland_create_constraint (MetaPointerConfinementWaylan
meta_wayland_surface_get_absolute_coordinates (surface, 0, 0, &dx, &dy);
min_edge_distance = wl_fixed_to_double (1) * geometry_scale;
constraint = meta_pointer_constraint_new (g_steal_pointer (&region),
constraint = meta_pointer_constraint_new (region,
GRAPHENE_POINT_INIT (dx, dy),
min_edge_distance);

View file

@ -77,7 +77,7 @@ meta_pointer_lock_wayland_create_constraint (MetaPointerConfinementWayland *conf
rect = (MtkRectangle) { .x = 0, .y = 0, .width = 0, .height = 0 };
region = mtk_region_create_rectangle (&rect);
constraint = meta_pointer_constraint_new (g_steal_pointer (&region),
constraint = meta_pointer_constraint_new (region,
GRAPHENE_POINT_INIT (x, y),
0.0);