Skip to content

Maintain correct cursor size on displays with scale factors

Quantum requested to merge github/fork/quantum5/cursor-scales into master

When using a scale factor on a display, the cursor size was incorrectly handled. With multiple displays and differing scale factors on each display, this caused the cursor size to differ visibly between displays.

For example, I have two 27" monitors side by side. Monitor 1 runs at 2560×1440 with scale 1 and monitor 2 runs at 3840×2160 with scale 1.5. Everything should have the same apparent size on this setup. On monitor 1, everything looks good. On monitor 2:

  • in any UI rendered by sway, the cursor appears to be half size.
  • in native wayland applications, the cursor appears to be be quarter size.
  • on xwayland applications, the cursor appears to be the correct size.

It appears that cursor->output->impl->set_cursor considers the output scale but also divides the dimensions of the cursor by scale. Indeed, everywhere else this function is called in types/wlr_output.c, 1 is always passed as scale.

Passing 1 in output_cursor_attempt_hardware causes the cursor size to be correct in all cases.

Merge request reports

Loading