[mutter/wip/carlosg/input-thread: 72/160] backends: Fold device mapping check into backend
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/input-thread: 72/160] backends: Fold device mapping check into backend
- Date: Tue, 22 Sep 2020 12:33:57 +0000 (UTC)
commit b50f8998a757b1543eee5f539f78c2f7d6abb41f
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed May 6 20:20:49 2020 +0200
backends: Fold device mapping check into backend
Make the upper part agnostic about the device being relative in order
to avoid applying keep-aspect. The X11 bits already are, so make it
sure it's also the case for the native backend.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403
src/backends/meta-input-settings.c | 14 +++-----------
src/backends/native/meta-input-settings-native.c | 4 ++++
2 files changed, 7 insertions(+), 11 deletions(-)
---
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
index 0a0667688a..5015ef39a2 100644
--- a/src/backends/meta-input-settings.c
+++ b/src/backends/meta-input-settings.c
@@ -1050,17 +1050,9 @@ update_tablet_keep_aspect (MetaInputSettings *input_settings,
input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
- if (clutter_input_device_get_mapping_mode (device) ==
- CLUTTER_INPUT_DEVICE_MAPPING_ABSOLUTE)
- {
- keep_aspect = g_settings_get_boolean (settings, "keep-aspect");
- meta_input_settings_find_monitor (input_settings, settings, device,
- NULL, &logical_monitor);
- }
- else
- {
- keep_aspect = FALSE;
- }
+ keep_aspect = g_settings_get_boolean (settings, "keep-aspect");
+ meta_input_settings_find_monitor (input_settings, settings, device,
+ NULL, &logical_monitor);
input_settings_class->set_tablet_keep_aspect (input_settings, device,
logical_monitor, keep_aspect);
diff --git a/src/backends/native/meta-input-settings-native.c
b/src/backends/native/meta-input-settings-native.c
index 82719e7d83..7d25f4a5b5 100644
--- a/src/backends/native/meta-input-settings-native.c
+++ b/src/backends/native/meta-input-settings-native.c
@@ -536,6 +536,10 @@ meta_input_settings_native_set_tablet_keep_aspect (MetaInputSettings *settings,
{
double aspect_ratio = 0;
+ if (clutter_input_device_get_mapping_mode (device) ==
+ CLUTTER_INPUT_DEVICE_MAPPING_RELATIVE)
+ keep_aspect = FALSE;
+
if (keep_aspect)
{
int width, height;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]