[mutter] backends: Export function to query the mapped MetaMonitorInfo of a tablet
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] backends: Export function to query the mapped MetaMonitorInfo of a tablet
- Date: Fri, 22 Jul 2016 12:02:28 +0000 (UTC)
commit e2ad8700a9fc21c4220033b6de2d9f23edf23f12
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Jun 29 13:50:20 2016 +0200
backends: Export function to query the mapped MetaMonitorInfo of a tablet
Or NULL if the tablet is mapped to the full desktop size.
src/backends/meta-input-settings-private.h | 3 +++
src/backends/meta-input-settings.c | 24 ++++++++++++++++++++++++
2 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/src/backends/meta-input-settings-private.h b/src/backends/meta-input-settings-private.h
index e34dddf..1824beb 100644
--- a/src/backends/meta-input-settings-private.h
+++ b/src/backends/meta-input-settings-private.h
@@ -105,6 +105,9 @@ MetaInputSettings * meta_input_settings_create (void);
GSettings * meta_input_settings_get_tablet_settings (MetaInputSettings *settings,
ClutterInputDevice *device);
+MetaMonitorInfo * meta_input_settings_get_tablet_monitor_info (MetaInputSettings *settings,
+ ClutterInputDevice *device);
+
GDesktopTabletMapping meta_input_settings_get_tablet_mapping (MetaInputSettings *settings,
ClutterInputDevice *device);
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
index 559d92d..b6b091b 100644
--- a/src/backends/meta-input-settings.c
+++ b/src/backends/meta-input-settings.c
@@ -1294,6 +1294,30 @@ meta_input_settings_get_tablet_settings (MetaInputSettings *settings,
return info ? g_object_ref (info->settings) : NULL;
}
+MetaMonitorInfo *
+meta_input_settings_get_tablet_monitor_info (MetaInputSettings *settings,
+ ClutterInputDevice *device)
+{
+ MetaInputSettingsPrivate *priv;
+ DeviceMappingInfo *info;
+ MetaOutput *output;
+
+ g_return_val_if_fail (META_IS_INPUT_SETTINGS (settings), NULL);
+ g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), NULL);
+
+ priv = meta_input_settings_get_instance_private (settings);
+ info = g_hash_table_lookup (priv->mappable_devices, device);
+ if (!info)
+ return NULL;
+
+ output = meta_input_settings_find_output (settings, info->settings, device);
+
+ if (output && output->crtc)
+ return output->crtc->logical_monitor;
+
+ return NULL;
+}
+
GDesktopTabletMapping
meta_input_settings_get_tablet_mapping (MetaInputSettings *settings,
ClutterInputDevice *device)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]