[mutter] backends: Disable keep-aspect and output mapping on relative devices



commit b7892ba1c5089fcbe66c476ad8cfa807d2199f52
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Jun 22 15:42:11 2016 +0200

    backends: Disable keep-aspect and output mapping on relative devices
    
    Those settings make no sense there, so should be made ineffective.

 src/backends/meta-input-settings.c |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
index 4506782..8833b06 100644
--- a/src/backends/meta-input-settings.c
+++ b/src/backends/meta-input-settings.c
@@ -618,8 +618,17 @@ update_tablet_keep_aspect (MetaInputSettings  *input_settings,
     return;
 
   input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
-  keep_aspect = g_settings_get_boolean (settings, "keep-aspect");
-  output = meta_input_settings_find_output (input_settings, settings, device);
+
+  if (clutter_input_device_get_mapping_mode (device) ==
+      CLUTTER_INPUT_DEVICE_MAPPING_ABSOLUTE)
+    {
+      keep_aspect = g_settings_get_boolean (settings, "keep-aspect");
+      output = meta_input_settings_find_output (input_settings, settings, device);
+    }
+  else
+    {
+      keep_aspect = FALSE;
+    }
 
   input_settings_class->set_tablet_keep_aspect (input_settings, device,
                                                 output, keep_aspect);
@@ -641,7 +650,14 @@ update_device_display (MetaInputSettings  *input_settings,
 
   priv = meta_input_settings_get_instance_private (input_settings);
   input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
-  output = meta_input_settings_find_output (input_settings, settings, device);
+
+  /* If mapping is relative, the device can move on all displays */
+  if (clutter_input_device_get_device_type (device) != CLUTTER_TABLET_DEVICE ||
+      clutter_input_device_get_mapping_mode (device) ==
+      CLUTTER_INPUT_DEVICE_MAPPING_ABSOLUTE)
+    output = meta_input_settings_find_output (input_settings, settings, device);
+  else
+    output = NULL;
 
   if (output)
     meta_monitor_manager_get_monitor_matrix (priv->monitor_manager,


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