[gnome-settings-daemon/gnome-3-14] wacom: Return NULL area if there is no backing GdkDevice



commit 16958057fabdf6a5e5f94d877dc78eef46411cf4
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Feb 24 16:36:37 2015 +0100

    wacom: Return NULL area if there is no backing GdkDevice
    
    This may be true for testing GsdWacomDevices, which would cause warnings
    there.

 plugins/wacom/gsd-wacom-device.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-device.c b/plugins/wacom/gsd-wacom-device.c
index 1b18143..e06699a 100644
--- a/plugins/wacom/gsd-wacom-device.c
+++ b/plugins/wacom/gsd-wacom-device.c
@@ -1975,6 +1975,9 @@ gsd_wacom_device_get_default_area (GsdWacomDevice *device)
 
        g_return_val_if_fail (GSD_IS_WACOM_DEVICE (device), NULL);
 
+       if (!device->priv->gdk_device)
+               return NULL;
+
        g_object_get (device->priv->gdk_device, "device-id", &id, NULL);
 
        device_area = g_new0 (int, 4);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]