[nautilus] nautilus-application: don't create desktop on Wayland



commit c8f45f29239befdd2975402b09d25b066fec60ac
Author: Carlos Soriano <csoriano gnome org>
Date:   Mon Mar 16 15:18:38 2015 +0100

    nautilus-application: don't create desktop on Wayland
    
    We were doing some calls to the x11 backend, which are not supported on Wayland
    (or another backend diferent than X11) and the application were crashing when
    creating the desktop on Wayland.
    
    To workaround it, simply don't create the desktop if we are on
    a different backend than X11.
    
    Future work will be to split the main application and the desktop part.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746286

 src/nautilus-application.c |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 6a97aa5..605ea58 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -897,13 +897,31 @@ nautilus_application_set_desktop_visible (NautilusApplication *self,
 static void
 update_desktop_from_gsettings (NautilusApplication *self)
 {
+       GdkDisplay *display;
+       gboolean visible;
+
        /* desktop GSetting was overridden - don't do anything */
        if (self->priv->desktop_override) {
                return;
        }
 
-       nautilus_application_set_desktop_visible (self, g_settings_get_boolean (gnome_background_preferences,
-                                                                               
NAUTILUS_PREFERENCES_SHOW_DESKTOP));
+#ifdef GDK_WINDOWING_X11
+       display = gdk_display_get_default ();
+       visible = g_settings_get_boolean (gnome_background_preferences,
+                                          NAUTILUS_PREFERENCES_SHOW_DESKTOP);
+       if (!GDK_IS_X11_DISPLAY (display)) {
+               if (visible)
+                       g_warning ("Desktop icons only supported on X11. Desktop not created");
+
+               return;
+       }
+
+       nautilus_application_set_desktop_visible (self, visible);
+
+       return;
+#endif
+
+       g_warning ("Desktop icons only supported on X11. Desktop not created");
 }
 
 static void


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