[gnome-flashback] monitor-manager: don't apply unneeded orientation changes



commit bbf2caf2791c0b4f547800a81a213cc0f0782e65
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Sep 12 23:37:44 2021 +0300

    monitor-manager: don't apply unneeded orientation changes
    
    Based on mutter commit:
    https://gitlab.gnome.org/GNOME/mutter/-/commit/2289f56112a9

 backends/gf-monitor-manager.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/backends/gf-monitor-manager.c b/backends/gf-monitor-manager.c
index 11f6de7..ec85167 100644
--- a/backends/gf-monitor-manager.c
+++ b/backends/gf-monitor-manager.c
@@ -607,6 +607,14 @@ handle_orientation_change (GfOrientationManager *orientation_manager,
   GfMonitorTransform transform;
   GError *error = NULL;
   GfMonitorsConfig *config;
+  GfMonitor *laptop_panel;
+  GfLogicalMonitor *laptop_logical_monitor;
+
+  laptop_panel = gf_monitor_manager_get_laptop_panel (manager);
+  g_return_if_fail (laptop_panel);
+
+  if (!gf_monitor_is_active (laptop_panel))
+    return;
 
   switch (gf_orientation_manager_get_orientation (orientation_manager))
     {
@@ -628,6 +636,10 @@ handle_orientation_change (GfOrientationManager *orientation_manager,
         return;
     }
 
+  laptop_logical_monitor = gf_monitor_get_logical_monitor (laptop_panel);
+  if (gf_logical_monitor_get_transform (laptop_logical_monitor) == transform)
+    return;
+
   config = gf_monitor_config_manager_create_for_orientation (manager->config_manager,
                                                              transform);
 


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