[mutter/wip/carlosg/input-thread: 44/133] backends: Move device mapping check into backend
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/input-thread: 44/133] backends: Move device mapping check into backend
- Date: Thu, 13 Aug 2020 19:31:07 +0000 (UTC)
commit 0be0a142259fbcfd3e5f5f3256e8c77587e0bae7
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed May 6 20:27:14 2020 +0200
backends: Move device mapping check into backend
Make the upper parts agnostic about the device being relative in
order to apply the display mapping. Just make the low level bits
resort to the identity matrix for those.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403
src/backends/meta-input-settings.c | 29 ++++++++++--------------
src/backends/native/meta-input-settings-native.c | 15 ++++++++++--
2 files changed, 25 insertions(+), 19 deletions(-)
---
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
index d7bbcde9c8..fd6e32d0b4 100644
--- a/src/backends/meta-input-settings.c
+++ b/src/backends/meta-input-settings.c
@@ -1078,24 +1078,19 @@ 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);
- /* If mapping is relative, the device can move on all displays */
- if (clutter_input_device_get_device_type (device) == CLUTTER_TOUCHSCREEN_DEVICE ||
- clutter_input_device_get_mapping_mode (device) ==
- CLUTTER_INPUT_DEVICE_MAPPING_ABSOLUTE)
+ meta_input_settings_find_monitor (input_settings, settings, device,
+ &monitor, &logical_monitor);
+ if (monitor)
{
- meta_input_settings_find_monitor (input_settings, settings, device,
- &monitor, &logical_monitor);
- if (monitor)
- {
- meta_input_mapper_remove_device (priv->input_mapper, device);
- meta_monitor_manager_get_monitor_matrix (priv->monitor_manager,
- monitor, logical_monitor, matrix);
- }
- else
- {
- if (meta_input_settings_delegate_on_mapper (input_settings, device))
- return;
- }
+ meta_input_mapper_remove_device (priv->input_mapper, device);
+ meta_monitor_manager_get_monitor_matrix (priv->monitor_manager,
+ monitor, logical_monitor,
+ matrix);
+ }
+ else
+ {
+ if (meta_input_settings_delegate_on_mapper (input_settings, device))
+ return;
}
input_settings_class->set_matrix (input_settings, device, matrix);
diff --git a/src/backends/native/meta-input-settings-native.c
b/src/backends/native/meta-input-settings-native.c
index 6b483b633d..ce86f5b1ff 100644
--- a/src/backends/native/meta-input-settings-native.c
+++ b/src/backends/native/meta-input-settings-native.c
@@ -70,8 +70,19 @@ meta_input_settings_native_set_matrix (MetaInputSettings *settings,
{
cairo_matrix_t dev_matrix;
- cairo_matrix_init (&dev_matrix, matrix[0], matrix[3], matrix[1],
- matrix[4], matrix[2], matrix[5]);
+ if (clutter_input_device_get_device_type (device) ==
+ CLUTTER_TOUCHSCREEN_DEVICE ||
+ clutter_input_device_get_mapping_mode (device) ==
+ CLUTTER_INPUT_DEVICE_MAPPING_ABSOLUTE)
+ {
+ cairo_matrix_init (&dev_matrix, matrix[0], matrix[3], matrix[1],
+ matrix[4], matrix[2], matrix[5]);
+ }
+ else
+ {
+ cairo_matrix_init_identity (&dev_matrix);
+ }
+
g_object_set (device, "device-matrix", &dev_matrix, NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]