From ff453c114317858bfec2b8e1a3986c90807e86e3 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 28 Dec 2016 12:08:34 +0100 Subject: [PATCH] backends: Notify tablet mapping changes in the UI This takes over the older code in g-s-d. https://bugzilla.gnome.org/show_bug.cgi?id=771098 --- src/backends/meta-input-settings.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c index fc9a6946f..166e72897 100644 --- a/src/backends/meta-input-settings.c +++ b/src/backends/meta-input-settings.c @@ -1559,7 +1559,7 @@ meta_input_settings_cycle_tablet_output (MetaInputSettings *input_settings, MetaInputSettingsPrivate *priv; DeviceMappingInfo *info; MetaOutput *output; - const gchar *edid[4] = { 0 }; + const gchar *edid[4] = { 0 }, *pretty_name = NULL; g_return_if_fail (META_IS_INPUT_SETTINGS (input_settings)); g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device)); @@ -1571,10 +1571,14 @@ meta_input_settings_cycle_tablet_output (MetaInputSettings *input_settings, g_return_if_fail (info != NULL); #ifdef HAVE_LIBWACOM - /* Output rotation only makes sense on external tablets */ - if (info->wacom_device && - (libwacom_get_integration_flags (info->wacom_device) != WACOM_DEVICE_INTEGRATED_NONE)) - return; + if (info->wacom_device) + { + /* Output rotation only makes sense on external tablets */ + if (libwacom_get_integration_flags (info->wacom_device) != WACOM_DEVICE_INTEGRATED_NONE) + return; + + pretty_name = libwacom_get_name (info->wacom_device); + } #endif output = meta_input_settings_find_output (input_settings, @@ -1586,6 +1590,9 @@ meta_input_settings_cycle_tablet_output (MetaInputSettings *input_settings, edid[1] = output ? output->product : ""; edid[2] = output ? output->serial : ""; g_settings_set_strv (info->settings, "display", edid); + + meta_display_show_tablet_mapping_notification (meta_get_display (), + device, pretty_name); } static void