diff --git a/src/backends/meta-input-settings-private.h b/src/backends/meta-input-settings-private.h index e34dddf42..1824beb02 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 559d92d93..b6b091ba9 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)