From cc9bb7c516c5fd2ab48b66934538cc7a60e6a84a Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 15 Nov 2021 17:20:27 +0100 Subject: [PATCH] =?UTF-8?q?monitor-manager:=20Fix=20orientation=20changes?= =?UTF-8?q?=20on=20devices=20with=2090=C2=B0=20mounted=20panels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: --- 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 6ff23cac9..1a68d71e0 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 =