[mutter/wip/carlosg/fix-pad-osds-position: 46/46] backends: Check both input settings and mapper for tablet monitors
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/fix-pad-osds-position: 46/46] backends: Check both input settings and mapper for tablet monitors
- Date: Fri, 10 Jan 2020 16:27:03 +0000 (UTC)
commit 65c1a0caa16805d5a2e5b93558bec7eb3fd7dae6
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Dec 13 15:26:05 2019 +0100
backends: Check both input settings and mapper for tablet monitors
The upper layers (OSDs basically) want to know the monitor that a
tablet is currently assigned to, not the monitor just as configured
through settings.
This broke proper OSD positioning for display-attached tablets since
commit 87858a4e01d9, as the MetaInputMapper kicks in precisely when
there is no configured monitor for the given device.
Consulting both about the assigned output will make OSDs pop up
again in the right place.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/971
src/backends/meta-input-mapper-private.h | 3 +++
src/backends/meta-input-mapper.c | 26 ++++++++++++++++++++++++++
src/backends/meta-input-settings.c | 11 +++++++++--
3 files changed, 38 insertions(+), 2 deletions(-)
---
diff --git a/src/backends/meta-input-mapper-private.h b/src/backends/meta-input-mapper-private.h
index 34314577f..cdfdccde9 100644
--- a/src/backends/meta-input-mapper-private.h
+++ b/src/backends/meta-input-mapper-private.h
@@ -42,5 +42,8 @@ ClutterInputDevice *
meta_input_mapper_get_logical_monitor_device (MetaInputMapper *mapper,
MetaLogicalMonitor *logical_monitor,
ClutterInputDeviceType device_type);
+MetaLogicalMonitor *
+meta_input_mapper_get_device_logical_monitor (MetaInputMapper *mapper,
+ ClutterInputDevice *device);
#endif /* META_INPUT_MAPPER_H */
diff --git a/src/backends/meta-input-mapper.c b/src/backends/meta-input-mapper.c
index fc4f3bd59..fe02ab8c7 100644
--- a/src/backends/meta-input-mapper.c
+++ b/src/backends/meta-input-mapper.c
@@ -675,3 +675,29 @@ meta_input_mapper_get_logical_monitor_device (MetaInputMapper *mapper,
return NULL;
}
+
+MetaLogicalMonitor *
+meta_input_mapper_get_device_logical_monitor (MetaInputMapper *mapper,
+ ClutterInputDevice *device)
+{
+ MetaMapperOutputInfo *output;
+ MetaLogicalMonitor *logical_monitor;
+ GHashTableIter iter;
+ GList *l;
+
+ g_hash_table_iter_init (&iter, mapper->output_devices);
+
+ while (g_hash_table_iter_next (&iter, (gpointer *) &logical_monitor,
+ (gpointer *) &output))
+ {
+ for (l = output->input_devices; l; l = l->next)
+ {
+ MetaMapperInputInfo *input = l->data;
+
+ if (input->device == device)
+ return logical_monitor;
+ }
+ }
+
+ return NULL;
+}
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
index 28dc387ef..a1e0895d8 100644
--- a/src/backends/meta-input-settings.c
+++ b/src/backends/meta-input-settings.c
@@ -2053,8 +2053,15 @@ meta_input_settings_get_tablet_logical_monitor (MetaInputSettings *settings,
if (!info)
return NULL;
- meta_input_settings_find_monitor (settings, info->settings, device,
- NULL, &logical_monitor);
+ logical_monitor =
+ meta_input_mapper_get_device_logical_monitor (priv->input_mapper, device);
+
+ if (!logical_monitor)
+ {
+ meta_input_settings_find_monitor (settings, info->settings, device,
+ NULL, &logical_monitor);
+ }
+
return logical_monitor;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]