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
This commit is contained in:
Carlos Soriano 2015-03-16 15:18:38 +01:00
parent f826a582a1
commit c8f45f2923

View file

@ -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