wl_output::mode dimensions are pre-transformed even when the display reports a transform value
Affected version
GNOME/Mutter 43.1 Fedora 37
Bug summary
Current versions of Mutter now report proper WL_OUTPUT_TRANSFORM_*
values for displays, however, the width/height values reported by wl_output::mode
are still being pre-transformed for rotated displays.
Steps to reproduce
- Set a display (1920x1080 for this example) to portrait mode, rotated 90 degrees
- Enumerate the wl_output objects on the system
What happened
-
wl_output::geometry
reports a transform ofWL_OUTPUT_TRANSFORM_90
-
wl_output::mode
reports transformed display dimensions of 1080x1920
What did you expect to happen
Per the spec, wl_output should report the 'physical' attributes of the device, so 1920x1080 in this case as rotating a display is a logical operation. This causes problems as clients will then apply the reported transformation to these pre-transformed values reported by Mutter, which for 90/270 degree rotations involves swapping the width and height, and the end result is reversed (unrotated) from what it should be. Other compositors, such as KWin and Sway/wlroots, always report the untransformed display dimensions and require manually applying the given transformation, so GNOME/Mutter is currently broken on these existing code paths.