summaryrefslogtreecommitdiff
path: root/src/backends/x11
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2017-10-25 15:44:10 +0200
committerJonas Ã…dahl <jadahl@gmail.com>2017-12-25 17:01:45 +0800
commit0bbda3ad87257f0c64a21253a1f6f585b342b018 (patch)
tree09db00bf28a581dfbce650478db228fe146f1082 /src/backends/x11
parentdd43d04d42af0bd3757b03f589035e104cc74427 (diff)
downloadmutter-0bbda3ad87257f0c64a21253a1f6f585b342b018.tar.gz
monitor-manager: Take panel-orientation into account for physical size
Just like we swap the x and y resolution of the monitor modes when the panel-orientation requires 90 or 270 degree rotation to compensate, we should do the same for the width and height in mm of the monitor. https://bugzilla.gnome.org/show_bug.cgi?id=782294
Diffstat (limited to 'src/backends/x11')
-rw-r--r--src/backends/x11/meta-output-xrandr.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/backends/x11/meta-output-xrandr.c b/src/backends/x11/meta-output-xrandr.c
index 4fed6e5d9..1f44cb168 100644
--- a/src/backends/x11/meta-output-xrandr.c
+++ b/src/backends/x11/meta-output-xrandr.c
@@ -769,8 +769,6 @@ meta_create_xrandr_output (MetaGpuXrandr *gpu_xrandr,
meta_output_parse_edid (output, edid);
g_bytes_unref (edid);
- output->width_mm = xrandr_output->mm_width;
- output->height_mm = xrandr_output->mm_height;
output->subpixel_order = COGL_SUBPIXEL_ORDER_UNKNOWN;
output->hotplug_mode_update = output_get_hotplug_mode_update (output);
output->suggested_x = output_get_suggested_x (output);
@@ -779,6 +777,18 @@ meta_create_xrandr_output (MetaGpuXrandr *gpu_xrandr,
output->panel_orientation_transform =
output_get_panel_orientation_transform (output);
+ if (meta_monitor_transform_is_rotated (
+ output->panel_orientation_transform))
+ {
+ output->width_mm = xrandr_output->mm_height;
+ output->height_mm = xrandr_output->mm_width;
+ }
+ else
+ {
+ output->width_mm = xrandr_output->mm_width;
+ output->height_mm = xrandr_output->mm_height;
+ }
+
output_get_tile_info (output);
output_get_modes (output, xrandr_output);
output_get_crtcs (output, xrandr_output);