[gtk+] GtkSettings: add shell-shows-app-menu property



commit f826dd548109752dcb44c63fb6ed98f4d9b37f0c
Author: Ryan Lortie <desrt desrt ca>
Date:   Tue Nov 29 22:28:11 2011 -0500

    GtkSettings: add shell-shows-app-menu property
    
    This is a boolean property that will be set to TRUE if the current
    desktop environment is capable of displaying the application menu as
    part of the desktop shell.
    
    If it is FALSE then the application will need to display the menu for
    itself.

 gdk/x11/gdksettings.c |    6 ++++--
 gtk/gtksettings.c     |   12 +++++++++++-
 2 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/gdk/x11/gdksettings.c b/gdk/x11/gdksettings.c
index 7a876f0..2398045 100644
--- a/gdk/x11/gdksettings.c
+++ b/gdk/x11/gdksettings.c
@@ -81,7 +81,8 @@ static const char gdk_settings_names[] =
   "Net/EnableEventSounds\0"   "gtk-enable-event-sounds\0"
   "Gtk/CursorBlinkTimeout\0"  "gtk-cursor-blink-timeout\0"
   "Gtk/AutoMnemonics\0"       "gtk-auto-mnemonics\0"
-  "Gtk/VisibleFocus\0"        "gtk-visible-focus\0";
+  "Gtk/VisibleFocus\0"        "gtk-visible-focus\0"
+  "Gtk/ShellShowsAppMenu\0"   "gtk-shell-shows-app-menu\0";
 
 
 static const struct
@@ -135,5 +136,6 @@ static const struct
   { 1636, 1658 },
   { 1682, 1705 },
   { 1730, 1748 },
-  { 1767, 1784 }
+  { 1767, 1784 },
+  { 1802, 1824 }
 };
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index 92d5fdb..1faee34 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -203,7 +203,8 @@ enum {
   PROP_LABEL_SELECT_ON_FOCUS,
   PROP_COLOR_PALETTE,
   PROP_IM_PREEDIT_STYLE,
-  PROP_IM_STATUS_STYLE
+  PROP_IM_STATUS_STYLE,
+  PROP_SHELL_SHOWS_APP_MENU
 };
 
 /* --- prototypes --- */
@@ -1323,6 +1324,15 @@ gtk_settings_class_init (GtkSettingsClass *class)
                                              gtk_rc_property_parse_enum);
   g_assert (result == PROP_IM_STATUS_STYLE);
 
+  result = settings_install_property_parser (class,
+                                             g_param_spec_boolean ("gtk-shell-shows-app-menu",
+                                                                   P_("Desktop shell shows app menu"),
+                                                                   P_("Set to true if the desktop environment is displaying the app menu, FALSE if the app should display it itself."),
+                                                                   FALSE, GTK_PARAM_READWRITE),
+                                             NULL);
+  g_assert (result == PROP_SHELL_SHOWS_APP_MENU);
+
+
   g_type_class_add_private (class, sizeof (GtkSettingsPrivate));
 }
 



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