[mutter] monitor-tiled: Derive the dimension from what was configured
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] monitor-tiled: Derive the dimension from what was configured
- Date: Thu, 9 Mar 2017 02:21:42 +0000 (UTC)
commit 4cfcd4bce08926e4e9005cd912c81e83819194d5
Author: Jonas Ådahl <jadahl gmail com>
Date: Wed Mar 8 15:53:24 2017 +0800
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
src/backends/meta-monitor.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c
index 57eea84..f6eb227 100644
--- a/src/backends/meta-monitor.c
+++ b/src/backends/meta-monitor.c
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]