[mutter] monitor-manager: Don't apply unneeded orientation changes
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] monitor-manager: Don't apply unneeded orientation changes
- Date: Sat, 4 Sep 2021 09:12:41 +0000 (UTC)
commit 2289f56112a95b5a30853d986e82814ecbe88433
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date: Fri May 1 15:34:25 2020 +0200
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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1233>
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 ce02103f15..cffa8922bd 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]