[mutter] monitor-manager: Fix orientation changes on devices with 90° mounted panels



commit cc9bb7c516c5fd2ab48b66934538cc7a60e6a84a
Author: Hans de Goede <hdegoede redhat com>
Date:   Mon Nov 15 17:20:27 2021 +0100

    monitor-manager: Fix orientation changes on devices with 90° mounted panels
    
    Commit 2289f56112a9 ("monitor-manager: Don't apply unneeded orientation
    changes") added an early return to handle_orientation_change () in case
    the transform is unchanged.
    
    But this did not take the correction of the transform for devices
    with 90° mounted panels into account causing a desired orientation
    change to get skipped if the new orientation matches the corrected
    logical orientation from the previous transform setting.
    
    Fix this by calling meta_monitor_crtc_to_logical_transform () on the
    transform before comparing it, matching the
    meta_monitor_crtc_to_logical_transform () call in
    create_for_builtin_display_rotation ().
    
    Related: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1233
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2090>

 src/backends/meta-monitor-manager.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
index 6ff23cac9f..1a68d71e0d 100644
--- a/src/backends/meta-monitor-manager.c
+++ b/src/backends/meta-monitor-manager.c
@@ -869,6 +869,7 @@ handle_orientation_change (MetaOrientationManager *orientation_manager,
 {
   MetaOrientation orientation;
   MetaMonitorTransform transform;
+  MetaMonitorTransform panel_transform;
   GError *error = NULL;
   MetaMonitorsConfig *config;
   MetaMonitor *laptop_panel;
@@ -885,7 +886,10 @@ handle_orientation_change (MetaOrientationManager *orientation_manager,
   transform = meta_monitor_transform_from_orientation (orientation);
 
   laptop_logical_monitor = meta_monitor_get_logical_monitor (laptop_panel);
-  if (meta_logical_monitor_get_transform (laptop_logical_monitor) == transform)
+  panel_transform =
+    meta_monitor_crtc_to_logical_transform (laptop_panel, transform);
+  if (meta_logical_monitor_get_transform (laptop_logical_monitor) ==
+      panel_transform)
     return;
 
   current_config =


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