From 94aaa65bd240855a83525b7f9875c624cd8fc503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 13 Jun 2022 10:20:08 +0200 Subject: [PATCH] pointer-constraints/native: Remove old clutter float math work around There were some coordinate nudging to avoid running into Clutter floating point math issues related to coordinate transformations. Over the years these things have improved, especially with the move to graphene, so remove the old work around. Part-of: --- .../native/meta-pointer-constraint-native.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/backends/native/meta-pointer-constraint-native.c b/src/backends/native/meta-pointer-constraint-native.c index 6a1c066ad..93f75a283 100644 --- a/src/backends/native/meta-pointer-constraint-native.c +++ b/src/backends/native/meta-pointer-constraint-native.c @@ -409,23 +409,13 @@ clamp_to_border (MetaBorder *border, * clamped so that the destination coordinate does not end up on the border * (see weston_pointer_clamp_event_to_region). Do this by clamping such * motions to the border minus the smallest possible wl_fixed_t value. - * - * When clamping in either leftward or upward motion, the resulting coordinate - * needs to be clamped so that it is enough on the inside to avoid the - * inaccuracies of clutter's stage to actor transformation algorithm (the one - * used in clutter_actor_transform_stage_point) to make it end up outside the - * next motion. It also needs to be clamped so that to the wl_fixed_t - * coordinate may still be right on the border (i.e. at .0). Testing shows - * that the smallest wl_fixed_t value divided by 10 is small enough to make - * the wl_fixed_t coordinate .0 and large enough to avoid the inaccuracies of - * clutters transform algorithm. */ if (meta_border_is_horizontal (border)) { if (*motion_dir & META_BORDER_MOTION_DIRECTION_POSITIVE_Y) motion->b.y = border->line.a.y - wl_fixed_to_double (1); else - motion->b.y = border->line.a.y + wl_fixed_to_double (1) / 10; + motion->b.y = border->line.a.y; *motion_dir &= ~(META_BORDER_MOTION_DIRECTION_POSITIVE_Y | META_BORDER_MOTION_DIRECTION_NEGATIVE_Y); } @@ -434,7 +424,7 @@ clamp_to_border (MetaBorder *border, if (*motion_dir & META_BORDER_MOTION_DIRECTION_POSITIVE_X) motion->b.x = border->line.a.x - wl_fixed_to_double (1); else - motion->b.x = border->line.a.x + wl_fixed_to_double (1) / 10; + motion->b.x = border->line.a.x; *motion_dir &= ~(META_BORDER_MOTION_DIRECTION_POSITIVE_X | META_BORDER_MOTION_DIRECTION_NEGATIVE_X); }