[gnome-settings-daemon] wacom: Ensure the "display" setting is set on the right schema
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] wacom: Ensure the "display" setting is set on the right schema
- Date: Tue, 20 Jan 2015 19:43:59 +0000 (UTC)
commit 0002e5d2f719cccdb3600d7e4963b9d28be530c7
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Jan 20 18:30:46 2015 +0100
wacom: Ensure the "display" setting is set on the right schema
This code was brought back after reverting f4b8633745c, make sure
it uses the right GSettings.
https://bugzilla.gnome.org/show_bug.cgi?id=743196
plugins/wacom/gsd-wacom-device.c | 24 ++++++++++++++++++++++--
1 files changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-device.c b/plugins/wacom/gsd-wacom-device.c
index 4fbd85e..4c33052 100644
--- a/plugins/wacom/gsd-wacom-device.c
+++ b/plugins/wacom/gsd-wacom-device.c
@@ -605,12 +605,19 @@ find_output_by_display (GnomeRRScreen *rr_screen, GsdWacomDevice *device)
GVariant *display;
const gchar **edid;
GnomeRROutput *ret;
+ GsdDevice *gsd_device;
if (device == NULL)
return NULL;
+ gsd_device = gsd_x11_device_manager_lookup_gdk_device (GSD_X11_DEVICE_MANAGER (gsd_device_manager_get
()),
+ device->priv->gdk_device);
+
+ if (gsd_device == NULL)
+ return NULL;
+
ret = NULL;
- tablet = device->priv->wacom_settings;
+ tablet = gsd_device_get_settings (gsd_device);
display = g_settings_get_value (tablet, "display");
edid = g_variant_get_strv (display, &n);
@@ -627,6 +634,7 @@ find_output_by_display (GnomeRRScreen *rr_screen, GsdWacomDevice *device)
out:
g_free (edid);
g_variant_unref (display);
+ g_object_unref (tablet);
return ret;
}
@@ -693,12 +701,23 @@ set_display_by_output (GsdWacomDevice *device,
gsize nvalues;
gchar *o_vendor, *o_product, *o_serial;
const gchar *values[3];
+ GsdDevice *gsd_device;
+
+ if (device == NULL)
+ return;
+
+ gsd_device = gsd_x11_device_manager_lookup_gdk_device (GSD_X11_DEVICE_MANAGER (gsd_device_manager_get
()),
+ device->priv->gdk_device);
+
+ if (gsd_device == NULL)
+ return;
- tablet = gsd_wacom_device_get_settings (device);
+ tablet = gsd_device_get_settings (gsd_device);
c_array = g_settings_get_value (tablet, "display");
g_variant_get_strv (c_array, &nvalues);
if (nvalues != 3) {
g_warning ("Unable set set display property. Got %"G_GSIZE_FORMAT" items; expected %d
items.\n", nvalues, 4);
+ g_object_unref (tablet);
return;
}
@@ -722,6 +741,7 @@ set_display_by_output (GsdWacomDevice *device,
g_free (o_vendor);
g_free (o_product);
g_free (o_serial);
+ g_object_unref (tablet);
}
static GsdWacomRotation
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]