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:
parent
e466a1bccc
commit
5a5a506f57
2 changed files with 2 additions and 2 deletions
|
@ -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 (®ion),
|
||||
constraint = meta_pointer_constraint_new (region,
|
||||
GRAPHENE_POINT_INIT (dx, dy),
|
||||
min_edge_distance);
|
||||
|
||||
|
|
|
@ -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 (®ion),
|
||||
constraint = meta_pointer_constraint_new (region,
|
||||
GRAPHENE_POINT_INIT (x, y),
|
||||
0.0);
|
||||
|
||||
|
|
Loading…
Reference in a new issue