From e3b41c5c554cc5aadf44183866ff4df7c2957d09 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Wed, 20 Nov 2024 13:21:09 -0800 Subject: [PATCH] input: Apply output transform to touch/tablet events --- src/input/mod.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/input/mod.rs b/src/input/mod.rs index 0c3e4ce2..8b40908e 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -2146,10 +2146,14 @@ where B::Device: 'static, { let geometry = output.geometry(); - event - .position_transformed(geometry.size.as_logical()) - .as_global() - + geometry.loc.to_f64() + let transform = output.current_transform(); + let size = transform + .invert() + .transform_size(geometry.size.as_logical()); + geometry.loc.to_f64() + + transform + .transform_point_in(event.position_transformed(size), &size.to_f64()) + .as_global() } // TODO Is it possible to determine mapping for external touchscreen?