Skip to content

wayland: Fix misreporting of scale and resolution of rotated monitors

Ben Mather requested to merge bwhmather/gtk:rotate-wl-output-geometry into main

In wayland there are two standard protocols for getting information about outputs:

  • WL Output (part of the core protocol) - Reports output resolution without scaling or rotation applied.
  • XDG Output (standalone) - Reports output resolution with scaling and rotation applied.

GDK prefers to use the information from the XDG Output protocol but falls back to WL Output.

Currently, the WL Output geometry is not rotated. This means that GDK will report the rotated size when XDG Output is available and the unrotated size when it is not.

Also, when XDG Output is available GDK derives the scale factor from the ration of XDG Output geometry to WL Output geometry. If WL Output geometry is not rotated then this will be multiplied by the aspect ratio.

Merge request reports