[gnome-control-center] wacom: Update from gnome-settings-daemon
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] wacom: Update from gnome-settings-daemon
- Date: Thu, 16 Feb 2012 18:34:17 +0000 (UTC)
commit 030513fbe14dbbd589f0efa87a23717299fc55dc
Author: Bastien Nocera <hadess hadess net>
Date: Thu Feb 16 17:28:33 2012 +0100
wacom: Update from gnome-settings-daemon
panels/wacom/gsd-wacom-device.c | 36 +++++++++++++++++++++---------------
1 files changed, 21 insertions(+), 15 deletions(-)
---
diff --git a/panels/wacom/gsd-wacom-device.c b/panels/wacom/gsd-wacom-device.c
index a1f43c3..d471e1c 100644
--- a/panels/wacom/gsd-wacom-device.c
+++ b/panels/wacom/gsd-wacom-device.c
@@ -494,9 +494,19 @@ find_output_by_edid (const gchar *vendor, const gchar *product, const gchar *ser
GnomeRROutputInfo **rr_output_info;
GnomeRROutputInfo *retval = NULL;
- /* TODO: Check the value of 'error' */
rr_screen = gnome_rr_screen_new (gdk_screen_get_default (), &error);
+ if (rr_screen == NULL) {
+ g_warning ("Failed to create GnomeRRScreen: %s", error->message);
+ g_error_free (error);
+ return NULL;
+ }
rr_config = gnome_rr_config_new_current (rr_screen, &error);
+ if (rr_config == NULL) {
+ g_warning ("Failed to get current screen configuration: %s", error->message);
+ g_error_free (error);
+ g_object_unref (rr_screen);
+ return NULL;
+ }
rr_output_info = gnome_rr_config_get_outputs (rr_config);
for (; *rr_output_info != NULL; rr_output_info++) {
@@ -528,6 +538,11 @@ find_output_by_edid (const gchar *vendor, const gchar *product, const gchar *ser
}
g_object_unref (rr_config);
+ g_object_unref (rr_screen);
+
+ if (retval == NULL)
+ g_debug ("Did not find a matching output for EDID '%s,%s,%s'",
+ vendor, product, serial);
return retval;
}
@@ -565,10 +580,8 @@ find_output_by_display (GsdWacomDevice *device)
return NULL;
}
- if (strlen(edid[0]) == 0 || strlen(edid[1]) == 0 || strlen(edid[2]) == 0) {
- g_warning ("EDID not completely defined.");
+ if (strlen(edid[0]) == 0 || strlen(edid[1]) == 0 || strlen(edid[2]) == 0)
return NULL;
- }
return find_output_by_edid (edid[0], edid[1], edid[2]);
}
@@ -694,19 +707,12 @@ find_output (GsdWacomDevice *device)
rr_output_info = find_output_by_display(device);
- if (rr_output_info == NULL)
- {
- g_warning ("No strict EDID match was found.");
-
- if (gsd_wacom_device_is_screen_tablet (device))
- {
+ if (rr_output_info == NULL) {
+ if (gsd_wacom_device_is_screen_tablet (device)) {
rr_output_info = find_output_by_heuristic (device);
- if (rr_output_info == NULL)
- {
+ if (rr_output_info == NULL) {
g_warning ("No fuzzy match based on heuristics was found.");
- }
- else
- {
+ } else {
g_warning("Automatically mapping tablet to heuristically-found display.");
set_display_by_output (device, rr_output_info);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]