[gtk+] Add a GtkSetting for 'shell-shows-desktop'



commit a90bb7de0eebcecbf94bb1fc6bf496f3743bb362
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu Nov 14 15:01:19 2013 -0500

    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(+), 0 deletions(-)
---
diff --git a/gdk/wayland/gdkscreen-wayland.c b/gdk/wayland/gdkscreen-wayland.c
index daf9b29..661ecd9 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 a4e2565..cd66259 100644
--- a/gdk/wayland/protocol/gtk-shell.xml
+++ b/gdk/wayland/protocol/gtk-shell.xml
@@ -4,6 +4,7 @@
     <enum name="capability">
       <entry name="global_app_menu" value="1"/>
       <entry name="global_menu_bar" value="2"/>
+      <entry name="desktop_icons" value="3"/>
     </enum>
     
     <event name="capabilities">
diff --git a/gdk/x11/gdksettings.c b/gdk/x11/gdksettings.c
index 6d2f87d..f9bc28e 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 329624b..01f2ef8 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -213,6 +213,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
 };
@@ -1529,6 +1530,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:
    *


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