From 2289f56112a95b5a30853d986e82814ecbe88433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 1 May 2020 15:34:25 +0200 Subject: [PATCH] monitor-manager: Don't apply unneeded orientation changes There's no need to ensure monitor orientation changes if the wanted orientation is matching the current one. Part-of: --- src/backends/meta-monitor-manager.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c index ce02103f1..cffa8922b 100644 --- a/src/backends/meta-monitor-manager.c +++ b/src/backends/meta-monitor-manager.c @@ -811,6 +811,14 @@ handle_orientation_change (MetaOrientationManager *orientation_manager, MetaMonitorTransform transform; GError *error = NULL; MetaMonitorsConfig *config; + MetaMonitor *laptop_panel; + MetaLogicalMonitor *laptop_logical_monitor; + + laptop_panel = meta_monitor_manager_get_laptop_panel (manager); + g_return_if_fail (laptop_panel); + + if (!meta_monitor_is_active (laptop_panel)) + return; switch (meta_orientation_manager_get_orientation (orientation_manager)) { @@ -832,6 +840,10 @@ handle_orientation_change (MetaOrientationManager *orientation_manager, return; } + laptop_logical_monitor = meta_monitor_get_logical_monitor (laptop_panel); + if (meta_logical_monitor_get_transform (laptop_logical_monitor) == transform) + return; + config = meta_monitor_config_manager_create_for_orientation (manager->config_manager, transform);