backends/native: Allow infinitely small pointer constraint regions

The small catch is that MtkRegion (and pixman regions) "optimize away"
0-size rectangles, so a 0-sized region will always be seen as having
a 0,0 origin. We don't want that, so transfer the origin separately from
the region.

While at it, make the Wayland pointer lock use one such 0-size region,
to avoid the 1x1px wiggle room that it currently has (accounting for subpixel
motion).

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3420>
This commit is contained in:
Carlos Garnacho
2023-11-17 18:15:27 +01:00
committed by Robert Mader
parent c931ed0d81
commit 07d24fe502
7 changed files with 47 additions and 15 deletions

View File

@ -37,6 +37,7 @@ G_DECLARE_FINAL_TYPE (MetaPointerConstraintImplNative,
MetaPointerConstraintImpl * meta_pointer_constraint_impl_native_new (MetaPointerConstraint *constraint_impl,
const MtkRegion *region,
graphene_point_t origin,
double min_edge_distance);
G_END_DECLS