Skip to content

Fix mouse mapping on rotated Wayland screens#543

Closed
aydreas wants to merge 1 commit into
wayvr-org:mainfrom
aydreas:fix/rotated-screen-mouse
Closed

Fix mouse mapping on rotated Wayland screens#543
aydreas wants to merge 1 commit into
wayvr-org:mainfrom
aydreas:fix/rotated-screen-mouse

Conversation

@aydreas

@aydreas aydreas commented Jun 18, 2026

Copy link
Copy Markdown

When interacting with a rotated Wayland output, the mouse ends up in the wrong
spot - as if the screen wasn't rotated. The screen itself renders upright fine,
only the pointer is off.

Since #530, screen orientation is corrected at render time via texture-UV
remapping, so hit.uv is already in the output's upright/logical orientation.
But the screencopy path still set mouse_transform_original = output.transform,
which rotated that already-upright UV a second time - landing the cursor on the
un-rotated physical layout.

Fix: map the mouse with Transform::Normal. Logical coords for a rotated output
are already upright, so uv -> logical_pos + uv * logical_size is correct. X11 already used Normal.

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.
@galister

Copy link
Copy Markdown
Collaborator

have you tried just choosing the correct mapping via edit mode / mouse?

desktops map it differently so there's no single right solution.

@aydreas

aydreas commented Jun 18, 2026

Copy link
Copy Markdown
Author

Oh, I didn't know that existed. Thank you - that fixes it too. Would have saved me a bunch of time if I knew haha

@aydreas aydreas closed this Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants