[gnome-flashback] backends: adjust accelerometer rotation for panel-orientation



commit ef3ec78354b4803015919d5ee8ecc9a97b832303
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Tue Jul 16 20:11:48 2019 +0300

    backends: adjust accelerometer rotation for panel-orientation
    
    Based on mutter commit:
    https://gitlab.gnome.org/GNOME/mutter/commit/f12e6ad4f18c34c30777

 backends/gf-monitor-config-manager.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
---
diff --git a/backends/gf-monitor-config-manager.c b/backends/gf-monitor-config-manager.c
index dd392cc..15a6094 100644
--- a/backends/gf-monitor-config-manager.c
+++ b/backends/gf-monitor-config-manager.c
@@ -405,6 +405,20 @@ create_for_builtin_display_rotation (GfMonitorConfigManager *config_manager,
 
   if (rotate)
     transform = (current_logical_monitor_config->transform + 1) % GF_MONITOR_TRANSFORM_FLIPPED;
+  else
+    {
+      GfMonitor *panel;
+
+      /*
+       * The transform coming from the accelerometer should be applied to
+       * the crtc as is, without taking panel-orientation into account, this
+       * is done so that non panel-orientation aware desktop environments do the
+       * right thing. Mutter corrects for panel-orientation when applying the
+       * transform from a logical-monitor-config, so we must convert here.
+       */
+      panel = gf_monitor_manager_get_laptop_panel (config_manager->monitor_manager);
+      transform = gf_monitor_crtc_to_logical_transform (panel, transform);
+    }
 
   if (current_logical_monitor_config->transform == transform)
     return NULL;


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