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>
This commit is contained in:
parent
c3e626405f
commit
650ef9b57f
@ -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…
x
Reference in New Issue
Block a user