1
0
Fork 0

monitor-tiled: Derive the dimension from what was configured

Previously, the size of the logical monitor was derived directly from
the tiling information. This works fine until we add transformations,
or set modes with a dimension different from the resulting resolution
when tiled. Fix this by traversing the assigned CRTC rects, as these
are already transformed by the configuration system.

https://bugzilla.gnome.org/show_bug.cgi?id=779745
This commit is contained in:
Jonas Ådahl 2017-03-08 15:53:24 +08:00
parent 4f386e5131
commit 4cfcd4bce0

View file

@ -702,11 +702,12 @@ meta_monitor_tiled_derive_dimensions (MetaMonitor *monitor,
MetaMonitorPrivate *monitor_priv =
meta_monitor_get_instance_private (monitor);
GList *l;
int width;
int height;
int min_x, min_y, max_x, max_y;
width = 0;
height = 0;
min_x = INT_MAX;
min_y = INT_MAX;
max_x = 0;
max_y = 0;
for (l = monitor_priv->outputs; l; l = l->next)
{
MetaOutput *output = l->data;
@ -714,15 +715,14 @@ meta_monitor_tiled_derive_dimensions (MetaMonitor *monitor,
if (!output->crtc)
continue;
if (output->tile_info.loc_v_tile == 0)
width += output->crtc->rect.width;
if (output->tile_info.loc_h_tile == 0)
height += output->crtc->rect.height;
min_x = MIN (output->crtc->rect.x, min_x);
min_y = MIN (output->crtc->rect.y, min_y);
max_x = MAX (output->crtc->rect.x + output->crtc->rect.width, max_x);
max_y = MAX (output->crtc->rect.y + output->crtc->rect.height, max_y);
}
*out_width = width;
*out_height = height;
*out_width = max_x - min_x;
*out_height = max_y - min_y;
}
static void