[mutter] monitor-config-manager: Fix 90/270 degree rotation not working



commit 1035200f26efaddc8c21194e775f11fedf2ee266
Author: Hans de Goede <hdegoede redhat com>
Date:   Sun Sep 17 12:07:12 2017 +0200

    monitor-config-manager: Fix 90/270 degree rotation not working
    
    When rotating 90/270 degrees we need to swap width and height. This fixes
    the screen going black and the following errors showing in the journal:
    
    gnome-shell[1097]: Failed to set CRTC mode 800x1280: No space left on device
    gnome-shell[1097]: Failed to flip: Device or resource busy
    gnome-shell[1097]: Failed to set CRTC mode 800x1280: No space left on device
    gnome-shell[1097]: Failed to set CRTC mode 800x1280: No space left on device
    
    When rotating a tablet with accelerometer 90/270 degrees.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=787836

 src/backends/meta-monitor-config-manager.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/backends/meta-monitor-config-manager.c b/src/backends/meta-monitor-config-manager.c
index 265269c..d40c2e0 100644
--- a/src/backends/meta-monitor-config-manager.c
+++ b/src/backends/meta-monitor-config-manager.c
@@ -764,6 +764,14 @@ create_for_builtin_display_rotation (MetaMonitorConfigManager *config_manager,
   logical_monitor_config->monitor_configs = g_list_append (NULL, monitor_config);
   logical_monitor_config->transform = transform;
 
+  if (meta_monitor_transform_is_rotated (current_logical_monitor_config->transform) !=
+      meta_monitor_transform_is_rotated (logical_monitor_config->transform))
+    {
+      int temp = logical_monitor_config->layout.width;
+      logical_monitor_config->layout.width = logical_monitor_config->layout.height;
+      logical_monitor_config->layout.height = temp;
+    }
+
   return meta_monitors_config_new (g_list_append (NULL, logical_monitor_config),
                                    config_manager->current_config->layout_mode,
                                    META_MONITORS_CONFIG_FLAG_NONE);


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