Skip to content

fix hardware cursor rendering on rotated/flipped monitors - #13574

Merged
vaxerski merged 1 commit into
hyprwm:mainfrom
JaSha256:fix/hardware-cursor-rotation
Mar 5, 2026
Merged

fix hardware cursor rendering on rotated/flipped monitors#13574
vaxerski merged 1 commit into
hyprwm:mainfrom
JaSha256:fix/hardware-cursor-rotation

Conversation

@JaSha256

@JaSha256 JaSha256 commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Replace the broken cairo_matrix_rotate() approach with explicit per-transform pattern matrices for all 8 wl_output_transform values.

Describe your PR, what does it fix/add?

Problem

  • cursor appears distorted, offset, or invisible on monitors with non-normal wl_output_transform
  • Old code used cairo_matrix_rotate(M_PI_2 * TR) which treats values 4-7 (flipped variants) as rotation angles — producing wrong results
  • This was marked as a known bug (FIXME: this is wrong, and doesn't work for 5, 6 and 7)

Fix

  • Replace rotate + translate with explicit Cairo matrixes
  • Each matrix directly encodes the inverse mapping (destination → source) including scaling

All 8 wl_output_transform variants should be handled correctly:

NORMAL, 90, 180, 270,

as well as

FLIPPED, FLIPPED_90, FLIPPED_180, FLIPPED_270

@github-actions

github-actions Bot commented Mar 4, 2026

Copy link
Copy Markdown

Hello and thank you for making a PR to Hyprland!

Please check the PR Guidelines and make sure your PR follows them.
It will make the entire review process faster. :)

If your code can be tested, please always add tests. See more here.

beep boop, I'm just a bot. A real human will review your PR soon.

Replace the broken cairo_matrix_rotate() approach with explicit
per-transform pattern matrices for all 8 wl_output_transform values.
@JaSha256
JaSha256 force-pushed the fix/hardware-cursor-rotation branch from b6c6e3c to ba62707 Compare March 5, 2026 00:07

@vaxerski vaxerski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tnx!

@vaxerski
vaxerski merged commit ae9ca17 into hyprwm:main Mar 5, 2026
9 of 10 checks passed
@JaSha256
JaSha256 deleted the fix/hardware-cursor-rotation branch March 5, 2026 20:35
vaxerski pushed a commit that referenced this pull request Mar 10, 2026
…13574)

Replace the broken cairo_matrix_rotate() approach with explicit
per-transform pattern matrices for all 8 wl_output_transform values.
vaxerski pushed a commit that referenced this pull request Mar 10, 2026
…13574)

Replace the broken cairo_matrix_rotate() approach with explicit
per-transform pattern matrices for all 8 wl_output_transform values.
crthpl pushed a commit to crthpl/Hyprland that referenced this pull request Jun 3, 2026
…yprwm#13574)

Replace the broken cairo_matrix_rotate() approach with explicit
per-transform pattern matrices for all 8 wl_output_transform values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants