For a rotated output, neither output transform nor swapped physical dimensions are reported.
I'm trying to programmatically compute the physical DPI from the information returned by the Wayland API wl_output_listener. I'm dividing the pixel width by the physical width.
However, it seems that for rotated screens, the output transform is reported as "normal" even though the width/height are swapped. For example, selecting "Portrait Right" in the Display settings, this is the output from weston-info, which matches what I get from wl_output_listener:
interface: 'wl_output', version: 2, name: 5
x: 0, y: 0, scale: 1,
physical_width: 530 mm, physical_height: 300 mm,
make: 'DEL', model: 'DELL P2415Q',
subpixel_orientation: unknown, output_transform: normal,
mode:
width: 2160 px, height: 3840 px, refresh: 59.997 Hz,
flags: current preferred
As you can see, the width and height are swapped, while the physical dimensions are not. Furthermore, the output_transform is "normal", leaving me with no reliable option to compute the output DPI. For comparison, here is the westen-info output when the display is in landscape mode:
interface: 'wl_output', version: 2, name: 5
x: 0, y: 0, scale: 1,
physical_width: 530 mm, physical_height: 300 mm,
make: 'DEL', model: 'DELL P2415Q',
subpixel_orientation: unknown, output_transform: normal,
mode:
width: 3840 px, height: 2160 px, refresh: 59.997 Hz,
flags: current preferred
I'm running Fedora 29 with an intel GPU:
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 530 (rev 06)
Mutter is version 3.30.1:
$ mutter --version
mutter 3.30.1
Copyright © 2001-2011 Havoc Pennington, Red Hat, Inc., and others
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.