From 02b00664950ccc7ffac245f59346164df85840ad Mon Sep 17 00:00:00 2001 From: andreas Date: Thu, 18 Jun 2026 17:53:00 +0200 Subject: [PATCH] Fix mouse mapping on rotated Wayland screens Screen content orientation is corrected at render time via texture-UV remapping, so pointer hits arrive in the upright logical orientation. Map the mouse without applying the output transform, avoiding a second rotation of the cursor position. --- wayvr/src/overlays/screen/wl.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wayvr/src/overlays/screen/wl.rs b/wayvr/src/overlays/screen/wl.rs index 899fc4be..3dd1cb6e 100644 --- a/wayvr/src/overlays/screen/wl.rs +++ b/wayvr/src/overlays/screen/wl.rs @@ -119,7 +119,10 @@ pub fn create_screens_wayland(wl: &mut WlxClient, app: &mut AppState) -> ScreenC { backend.logical_pos = vec2(output.logical_pos.0 as f32, output.logical_pos.1 as f32); backend.logical_size = vec2(output.logical_size.0 as f32, output.logical_size.1 as f32); - backend.mouse_transform_original = output.transform; + // The captured frame's orientation is corrected at render time (texture UV remap), + // so pointer hits land in the upright/logical space of the output. The compositor's + // logical coordinates are upright too, hence the mouse maps without rotation. + backend.mouse_transform_original = Transform::Normal; backend.apply_mouse_transform_with_override(Transform::Undefined); let window_config = create_screen_from_backend(