[gnome-settings-daemon] wacom: Make tablet configuration be per-machine
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] wacom: Make tablet configuration be per-machine
- Date: Wed, 25 Apr 2012 18:53:09 +0000 (UTC)
commit 604d636df67333d71e335cf77c2ca4278836e47e
Author: Bastien Nocera <hadess hadess net>
Date: Wed Apr 25 12:29:20 2012 +0100
wacom: Make tablet configuration be per-machine
As well as per-tablet, we apparently also need to be per-machine.
https://bugzilla.gnome.org/show_bug.cgi?id=674792
plugins/wacom/README.config-storage | 5 +++--
plugins/wacom/gsd-wacom-device.c | 21 +++++++++++++++++++--
2 files changed, 22 insertions(+), 4 deletions(-)
---
diff --git a/plugins/wacom/README.config-storage b/plugins/wacom/README.config-storage
index 167a341..645865e 100644
--- a/plugins/wacom/README.config-storage
+++ b/plugins/wacom/README.config-storage
@@ -13,9 +13,10 @@ configurations, whether on a single machine, or using a shared home directory.
The configuration scheme is:
schema: org.gnome.settings-daemon.peripherals.wacom
-path: /org/gnome/settings-daemon/peripherals/wacom/<device ID>/
+path: /org/gnome/settings-daemon/peripherals/wacom/<machine ID>-<device ID>/
-where <device ID> is a unique identifier for the tablet.
+where <machine ID> is the D-Bus machine-id for the machine, and
+<device ID> is a unique identifier for the tablet.
Stylus
------
diff --git a/plugins/wacom/gsd-wacom-device.c b/plugins/wacom/gsd-wacom-device.c
index f995546..ba29186 100644
--- a/plugins/wacom/gsd-wacom-device.c
+++ b/plugins/wacom/gsd-wacom-device.c
@@ -43,7 +43,7 @@
#define GSD_WACOM_STYLUS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_WACOM_STYLUS, GsdWacomStylusPrivate))
#define WACOM_TABLET_SCHEMA "org.gnome.settings-daemon.peripherals.wacom"
-#define WACOM_DEVICE_CONFIG_BASE "/org/gnome/settings-daemon/peripherals/wacom/%s/"
+#define WACOM_DEVICE_CONFIG_BASE "/org/gnome/settings-daemon/peripherals/wacom/%s-%s/"
#define WACOM_STYLUS_SCHEMA "org.gnome.settings-daemon.peripherals.wacom.stylus"
#define WACOM_ERASER_SCHEMA "org.gnome.settings-daemon.peripherals.wacom.eraser"
#define WACOM_BUTTON_SCHEMA "org.gnome.settings-daemon.peripherals.wacom.tablet-button"
@@ -1095,6 +1095,23 @@ gsd_wacom_device_add_modes (GsdWacomDevice *device,
}
}
+static char *
+settings_path_for_device (WacomDevice *wacom_device)
+{
+ char *machine_id, *settings_path;
+
+ machine_id = g_dbus_get_machine_id (NULL);
+ g_assert (machine_id);
+
+ settings_path = g_strdup_printf (WACOM_DEVICE_CONFIG_BASE,
+ machine_id,
+ libwacom_get_match (wacom_device));
+
+ g_free (machine_id);
+
+ return settings_path;
+}
+
static void
gsd_wacom_device_update_from_db (GsdWacomDevice *device,
WacomDevice *wacom_device,
@@ -1102,7 +1119,7 @@ gsd_wacom_device_update_from_db (GsdWacomDevice *device,
{
char *settings_path;
- settings_path = g_strdup_printf (WACOM_DEVICE_CONFIG_BASE, libwacom_get_match (wacom_device));
+ settings_path = settings_path_for_device (wacom_device);
device->priv->wacom_settings = g_settings_new_with_path (WACOM_TABLET_SCHEMA,
settings_path);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]