[gnome-settings-daemon] wacom: Remove use of removed "display" settings key
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] wacom: Remove use of removed "display" settings key
- Date: Fri, 13 Mar 2015 15:07:56 +0000 (UTC)
commit 50e5dc15b5e4434007e8413ed9d23e6ac00807ae
Author: Bastien Nocera <hadess hadess net>
Date: Fri Mar 13 08:22:05 2015 +0100
wacom: Remove use of removed "display" settings key
The display key moved from the Wacom specific schema, to a more generic
one. Read the EDID from the generic one.
https://bugzilla.gnome.org/show_bug.cgi?id=746113
plugins/wacom/list-wacom.c | 34 +++++++++++++++++++++++++++++++++-
1 files changed, 33 insertions(+), 1 deletions(-)
---
diff --git a/plugins/wacom/list-wacom.c b/plugins/wacom/list-wacom.c
index ca42b3c..95ccffe 100644
--- a/plugins/wacom/list-wacom.c
+++ b/plugins/wacom/list-wacom.c
@@ -23,6 +23,8 @@
#include <gtk/gtk.h>
#include "gsd-wacom-device.h"
+#include "gsd-device-manager.h"
+#include "gsd-device-manager-x11.h"
static gboolean fake_devices = FALSE;
static gboolean monitor_styli = FALSE;
@@ -180,6 +182,36 @@ last_stylus_changed (GsdWacomDevice *device,
print_stylus (stylus, TRUE);
}
+static char **
+get_edid (GsdWacomDevice *device)
+{
+ GdkDevice *gdk_device;
+ GsdDevice *gsd_device;
+ GSettings *gsd_settings;
+ char **edid;
+
+ g_object_get (device, "gdk-device", &gdk_device, NULL);
+ if (!gdk_device)
+ goto bail;
+
+ gsd_device = gsd_x11_device_manager_lookup_gdk_device (GSD_X11_DEVICE_MANAGER (gsd_device_manager_get
()),
+ gdk_device);
+ g_object_unref (gdk_device);
+ if (!gsd_device)
+ goto bail;
+
+ gsd_settings = gsd_device_get_settings (gsd_device);
+ g_object_unref (gsd_device);
+
+ edid = g_settings_get_strv (gsd_settings, "display");
+ g_object_unref (gsd_settings);
+
+ return edid;
+
+bail:
+ return g_strsplit (",,", ",", 3);
+}
+
static void
list_devices (GList *devices)
{
@@ -209,7 +241,7 @@ list_devices (GList *devices)
g_print ("\tGeneric settings: %s\n", loc);
g_free (loc);
- edid = g_settings_get_strv (settings, "display");
+ edid = get_edid (device);
if (!edid || g_strv_length (edid) != 3)
g_warning ("Invalid display EDID set for device");
else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]