[gnome-flashback] monitor-config-manager: reject a suggested config with gaps



commit 54cb73b6475b8959b08e5c6f8c6b07a44372423b
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Mon Sep 13 15:05:21 2021 +0300

    monitor-config-manager: reject a suggested config with gaps
    
    Based on mutter commit:
    https://gitlab.gnome.org/GNOME/mutter/-/commit/be9e6dcc4f1af6

 backends/gf-monitor-config-manager.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
---
diff --git a/backends/gf-monitor-config-manager.c b/backends/gf-monitor-config-manager.c
index 6cd52b6..971058d 100644
--- a/backends/gf-monitor-config-manager.c
+++ b/backends/gf-monitor-config-manager.c
@@ -1303,6 +1303,23 @@ gf_monitor_config_manager_create_suggested (GfMonitorConfigManager *config_manag
       region = g_list_prepend (region, &logical_monitor_config->layout);
     }
 
+  for (l = region; region->next && l; l = l->next)
+    {
+      GfRectangle *rect = l->data;
+
+      if (!gf_rectangle_is_adjacent_to_any_in_region (region, rect))
+        {
+          g_warning ("Suggested monitor config has monitors with no neighbors, "
+                     "rejecting");
+
+          g_list_free (region);
+          g_list_free_full (logical_monitor_configs,
+                            (GDestroyNotify) gf_logical_monitor_config_free);
+
+          return NULL;
+        }
+    }
+
   g_list_free (region);
 
   if (!logical_monitor_configs)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]