summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2015-03-16 15:18:38 +0100
committerCarlos Soriano <csoriano@gnome.org>2015-03-16 16:56:49 +0100
commitc8f45f29239befdd2975402b09d25b066fec60ac (patch)
treeb87ab84ecfb16f7d4cf1fa753194f85265125e6c
parentf826a582a13c6d90eb8fc6ec85f05969bbb330bd (diff)
downloadnautilus-c8f45f29239befdd2975402b09d25b066fec60ac.tar.gz
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
-rw-r--r--src/nautilus-application.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 6a97aa537..605ea581d 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