From e59a32afa5cd4884a68b331ffd0c5d9a40b6e029 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 22 Jun 2016 15:42:11 +0200 Subject: [PATCH] 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 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c index e6279f37f..b31f2bd18 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,