[mutter/wip/carlosg/abs-input-mapper: 120/122] backends: Add MetaInputMapper method to lookup devices from outputs
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/abs-input-mapper: 120/122] backends: Add MetaInputMapper method to lookup devices from outputs
- Date: Thu, 6 Dec 2018 14:45:23 +0000 (UTC)
commit faf89ff35fc5df123a303cc0ca99281b0dfa2115
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Apr 20 17:47:21 2018 +0200
backends: Add MetaInputMapper method to lookup devices from outputs
So we may know the device of a certain ClutterInputDeviceType that is
mapped to the given output.
src/backends/meta-input-mapper-private.h | 6 ++++++
src/backends/meta-input-mapper.c | 23 +++++++++++++++++++++++
2 files changed, 29 insertions(+)
---
diff --git a/src/backends/meta-input-mapper-private.h b/src/backends/meta-input-mapper-private.h
index 53bc66b06..34314577f 100644
--- a/src/backends/meta-input-mapper-private.h
+++ b/src/backends/meta-input-mapper-private.h
@@ -23,6 +23,7 @@
#define META_INPUT_MAPPER_H
#include <clutter/clutter.h>
+#include "meta-monitor-manager-private.h"
#define META_TYPE_INPUT_MAPPER (meta_input_mapper_get_type ())
@@ -37,4 +38,9 @@ void meta_input_mapper_add_device (MetaInputMapper *mapper,
void meta_input_mapper_remove_device (MetaInputMapper *mapper,
ClutterInputDevice *device);
+ClutterInputDevice *
+meta_input_mapper_get_logical_monitor_device (MetaInputMapper *mapper,
+ MetaLogicalMonitor *logical_monitor,
+ ClutterInputDeviceType device_type);
+
#endif /* META_INPUT_MAPPER_H */
diff --git a/src/backends/meta-input-mapper.c b/src/backends/meta-input-mapper.c
index 026dacb58..013c2a427 100644
--- a/src/backends/meta-input-mapper.c
+++ b/src/backends/meta-input-mapper.c
@@ -615,3 +615,26 @@ meta_input_mapper_remove_device (MetaInputMapper *mapper,
g_hash_table_remove (mapper->input_devices, device);
}
}
+
+ClutterInputDevice *
+meta_input_mapper_get_logical_monitor_device (MetaInputMapper *mapper,
+ MetaLogicalMonitor *logical_monitor,
+ ClutterInputDeviceType device_type)
+{
+ MetaMapperOutputInfo *output;
+ GList *l;
+
+ output = g_hash_table_lookup (mapper->output_devices, logical_monitor);
+ if (!output)
+ return NULL;
+
+ for (l = output->input_devices; l; l = l->next)
+ {
+ MetaMapperInputInfo *input = l->data;
+
+ if (clutter_input_device_get_device_type (input->device) == device_type)
+ return input->device;
+ }
+
+ return NULL;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]