[gnome-control-center] wacom: Avoid crashing when opening the panel on wayland sessions



commit 888e40eae8f26823f2e9bf0c37c45eafad467d07
Author: Rui Matos <tiagomatos gmail com>
Date:   Mon Jan 18 14:41:47 2016 +0100

    wacom: Avoid crashing when opening the panel on wayland sessions
    
    We don't yet support wacom devices under wayland and GsdWacomDevice
    uses X APIs unconditionally which makes us crash under wayland.
    
    Instead, let's return early and leave the GsdWacomDevice in an invalid
    state which means that we just present the default UI for "no wacom
    devices detected".

 panels/wacom/gsd-wacom-device.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/panels/wacom/gsd-wacom-device.c b/panels/wacom/gsd-wacom-device.c
index 52d6600..cef43a1 100644
--- a/panels/wacom/gsd-wacom-device.c
+++ b/panels/wacom/gsd-wacom-device.c
@@ -1428,7 +1428,8 @@ gsd_wacom_device_constructor (GType                     type,
                                                                                                
n_construct_properties,
                                                                                                
construct_properties));
 
-       if (device->priv->gdk_device == NULL)
+       if (device->priv->gdk_device == NULL ||
+           !GDK_IS_X11_DISPLAY (gdk_display_get_default ()))
                return G_OBJECT (device);
 
        device_manager = gdk_display_get_device_manager (gdk_display_get_default ());


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