mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
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
This commit is contained in:
parent
dd43d04d42
commit
0bbda3ad87
@ -489,8 +489,6 @@ meta_create_kms_output (MetaGpuKms *gpu_kms,
|
||||
output->gpu = gpu;
|
||||
output->winsys_id = connector->connector_id;
|
||||
output->name = make_output_name (connector);
|
||||
output->width_mm = connector->mmWidth;
|
||||
output->height_mm = connector->mmHeight;
|
||||
|
||||
switch (connector->subpixel)
|
||||
{
|
||||
@ -518,6 +516,17 @@ meta_create_kms_output (MetaGpuKms *gpu_kms,
|
||||
output_kms->connector = connector;
|
||||
find_connector_properties (gpu_kms, output);
|
||||
|
||||
if (meta_monitor_transform_is_rotated (output->panel_orientation_transform))
|
||||
{
|
||||
output->width_mm = connector->mmHeight;
|
||||
output->height_mm = connector->mmWidth;
|
||||
}
|
||||
else
|
||||
{
|
||||
output->width_mm = connector->mmWidth;
|
||||
output->height_mm = connector->mmHeight;
|
||||
}
|
||||
|
||||
init_output_modes (output, gpu_kms);
|
||||
|
||||
/* FIXME: MSC feature bit? */
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user