[mutter] monitor-config-manager: Verify monitor modes in logical monitor config
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] monitor-config-manager: Verify monitor modes in logical monitor config
- Date: Fri, 7 Apr 2017 14:34:19 +0000 (UTC)
commit 7eaeba520ac8ab19975e3f96150a9cd4f26a8f30
Author: Jonas Ådahl <jadahl gmail com>
Date: Tue Feb 14 19:43:10 2017 +0800
monitor-config-manager: Verify monitor modes in logical monitor config
Verify that each monitor in a logical monitor has the same dimensions,
i.e. that it they all fill out the same logical monitor space.
https://bugzilla.gnome.org/show_bug.cgi?id=777732
src/backends/meta-monitor-config-manager.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/backends/meta-monitor-config-manager.c b/src/backends/meta-monitor-config-manager.c
index 6996cd7..d64c700 100644
--- a/src/backends/meta-monitor-config-manager.c
+++ b/src/backends/meta-monitor-config-manager.c
@@ -865,6 +865,10 @@ gboolean
meta_verify_logical_monitor_config (MetaLogicalMonitorConfig *logical_monitor_config,
GError **error)
{
+ GList *l;
+ int layout_width;
+ int layout_height;
+
if (logical_monitor_config->scale < 1)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
@@ -890,6 +894,21 @@ meta_verify_logical_monitor_config (MetaLogicalMonitorConfig *logical_monitor_co
return FALSE;
}
+ layout_width = logical_monitor_config->layout.width;
+ layout_height = logical_monitor_config->layout.height;
+ for (l = logical_monitor_config->monitor_configs; l; l = l->next)
+ {
+ MetaMonitorConfig *monitor_config = l->data;
+
+ if (monitor_config->mode_spec->width != layout_width ||
+ monitor_config->mode_spec->height != layout_height)
+ {
+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Monitor modes in logical monitor conflict");
+ return FALSE;
+ }
+ }
+
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]