monitor-config-manager: Verify the layout origin is at (0, 0)

The extent of the layout regions must be a rectangle positioned at
(0, 0).

https://bugzilla.gnome.org/show_bug.cgi?id=777732
This commit is contained in:
Jonas Ådahl 2017-02-08 10:33:24 +08:00
parent 2035f2f2e2
commit 68a6cc5976

View File

@ -925,6 +925,7 @@ gboolean
meta_verify_monitors_config (MetaMonitorsConfig *config,
GError **error)
{
int min_x, min_y;
gboolean has_primary;
GList *region;
GList *l;
@ -936,6 +937,8 @@ meta_verify_monitors_config (MetaMonitorsConfig *config,
return FALSE;
}
min_x = INT_MAX;
min_y = INT_MAX;
region = NULL;
has_primary = FALSE;
for (l = config->logical_monitor_configs; l; l = l->next)
@ -970,11 +973,21 @@ meta_verify_monitors_config (MetaMonitorsConfig *config,
return FALSE;
}
min_x = MIN (logical_monitor_config->layout.x, min_x);
min_y = MIN (logical_monitor_config->layout.y, min_y);
region = g_list_prepend (region, &logical_monitor_config->layout);
}
g_list_free (region);
if (min_x != 0 || min_y != 0)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Logical monitors positions are offset");
return FALSE;
}
if (!has_primary)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,