From 6616677bd25176785c65d43c46e083ab30c8a72c Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Thu, 14 Nov 2013 15:01:19 -0500 Subject: [PATCH] Add a GtkSetting for 'shell-shows-desktop' Add a GtkSetting for whether the desktop shell is showing the desktop folder icons. This is on by default because most desktop shells do show the icons on the desktop. We already have a patch in gnome-settings-daemon to bind this to the org.gnome.desktop.background show-desktop-icons GSettings key which is off by default on GNOME. https://bugzilla.gnome.org/show_bug.cgi?id=712302 --- gdk/wayland/gdkscreen-wayland.c | 3 +++ gdk/wayland/protocol/gtk-shell.xml | 1 + gdk/x11/gdksettings.c | 1 + gtk/gtksettings.c | 11 +++++++++++ 4 files changed, 16 insertions(+) diff --git a/gdk/wayland/gdkscreen-wayland.c b/gdk/wayland/gdkscreen-wayland.c index daf9b29be1..661ecd9ec0 100644 --- a/gdk/wayland/gdkscreen-wayland.c +++ b/gdk/wayland/gdkscreen-wayland.c @@ -715,6 +715,9 @@ gdk_wayland_screen_get_setting (GdkScreen *screen, if (strcmp (name, "gtk-shell-shows-menubar") == 0) return set_capability_setting (screen, value, GTK_SHELL_CAPABILITY_GLOBAL_MENU_BAR); + if (strcmp (name, "gtk-shell-shows-desktop") == 0) + return set_capability_setting (screen, value, GTK_SHELL_CAPABILITY_DESKTOP_ICONS); + return FALSE; } diff --git a/gdk/wayland/protocol/gtk-shell.xml b/gdk/wayland/protocol/gtk-shell.xml index a4e25653f1..cd6625913b 100644 --- a/gdk/wayland/protocol/gtk-shell.xml +++ b/gdk/wayland/protocol/gtk-shell.xml @@ -4,6 +4,7 @@ + diff --git a/gdk/x11/gdksettings.c b/gdk/x11/gdksettings.c index 6d2f87d60b..f9bc28e206 100644 --- a/gdk/x11/gdksettings.c +++ b/gdk/x11/gdksettings.c @@ -57,6 +57,7 @@ static const struct { {"Gtk/CursorBlinkTimeout", "gtk-cursor-blink-timeout"}, {"Gtk/ShellShowsAppMenu", "gtk-shell-shows-app-menu"}, {"Gtk/ShellShowsMenubar", "gtk-shell-shows-menubar"}, + {"Gtk/ShellShowsDesktop", "gtk-shell-shows-desktop"}, {"Gtk/EnablePrimaryPaste", "gtk-enable-primary-paste"}, {"Gtk/RecentFilesMaxAge", "gtk-recent-files-max-age"}, {"Gtk/RecentFilesEnabled", "gtk-recent-files-enabled"}, diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c index 2640b3dfd2..3b5c5e7c07 100644 --- a/gtk/gtksettings.c +++ b/gtk/gtksettings.c @@ -209,6 +209,7 @@ enum { PROP_IM_STATUS_STYLE, PROP_SHELL_SHOWS_APP_MENU, PROP_SHELL_SHOWS_MENUBAR, + PROP_SHELL_SHOWS_DESKTOP, PROP_ENABLE_PRIMARY_PASTE, PROP_RECENT_FILES_ENABLED }; @@ -1527,6 +1528,16 @@ gtk_settings_class_init (GtkSettingsClass *class) NULL); g_assert (result == PROP_SHELL_SHOWS_MENUBAR); + result = settings_install_property_parser (class, + g_param_spec_boolean ("gtk-shell-shows-desktop", + P_("Desktop environment shows the desktop folder"), + P_("Set to TRUE if the desktop environment " + "is displaying the desktop folder, FALSE " + "if not."), + TRUE, GTK_PARAM_READWRITE), + NULL); + g_assert (result == PROP_SHELL_SHOWS_DESKTOP); + /** * GtkSettings:gtk-enable-primary-paste: *