Repository navigation
Display (Linux): fixes scale factor of rotated outputs on Wayland - #2745
Merged
Merged
Conversation
The scale factor is computed from the wl_output mode width and the zxdg_output_v1 logical width. The logical size is already transformed, but the mode is only swapped later in ffWaylandHandleRotation(), so a monitor rotated by 90 or 270 degrees compared its width with its logical height. A 1920x1200 monitor in portrait at scale 1 was reported as 1920 * 96 / 1200 = 153 dpi, shown as `@ 1.59x`. Compare with the mode height for 90 / 270 degree transforms instead.
Member
|
Thanks. Will cut a release this week. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Wayland, a monitor rotated by 90 or 270 degrees gets a wrong scale factor. For example, a 1920x1200 monitor in portrait mode at scale 1 is shown as:
handleXdgLogicalSize()computes the scale from thewl_outputmode width and thezxdg_output_v1logical width. The logical size is already transformed, but the mode is swapped only later, inffWaylandHandleRotation(). So a rotated output compares its width with its logical height: 1920 * 96 / 1200 = 153 dpi, shown as@ 1.59x.This PR compares the logical width with the mode height for the 90 / 270 degree transforms (
transform & WL_OUTPUT_TRANSFORM_90). Thewl_outputevents, including the transform fromgeometry, are all received beforeget_xdg_outputis requested, so the transform is known in that handler.Related issue (required for new logos for new distros)
None. I didn't find an existing issue.
Changes
src/detection/displayserver/linux/wayland/global-output.c: use the mode height instead of the width when the output is rotated by 90 / 270 degrees.CHANGELOG.md: Bugfixes entry.Screenshots
Text output only (
fastfetch --logo none -s display). I tested on dwl 0.9 / wlroots 0.20 with headless outputs at several transforms and scales.1080x1920 @ 1.77x1080x19201080x1920 @ 3.55x1080x1920 @ 2x2160x3840 @ 2.67x2160x3840 @ 1.5x3840x2160 @ 2x3840x2160 @ 2xI found the bug on a real 1920x1200 monitor in portrait mode next to a 4K monitor at scale 2, where it showed
@ 1.59xas above.Checklist