[gedit] Do not use the AppMenu with Unity and OSX



commit 255460c209105eadcaedb245ddfd6295cef06128
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Mar 24 18:38:44 2013 +0100

    Do not use the AppMenu with Unity and OSX
    
    Fixes bug https://bugzilla.gnome.org/show_bug.cgi?id=696425

 gedit/gedit-app.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index 605f98e..3f9c51e 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -1537,16 +1537,22 @@ _gedit_app_has_app_menu (GeditApp *app)
 {
        GtkSettings *gtk_settings;
        gboolean show_app_menu;
+       gboolean show_menubar;
 
        g_return_val_if_fail (GEDIT_IS_APP (app), FALSE);
 
+       /* We have three cases:
+        * - GNOME 3: show-app-menu true, show-menubar false -> use the app menu
+        * - Unity, OSX: show-app-menu and show-menubar true -> use the normal menu
+        * - Other WM, Windows: show-app-menu and show-menubar false -> use the normal menu
+        */
        gtk_settings = gtk_settings_get_default ();
        g_object_get (G_OBJECT (gtk_settings),
-                     "gtk-shell-shows-app-menu",
-                     &show_app_menu,
+                     "gtk-shell-shows-app-menu", &show_app_menu,
+                     "gtk-shell-shows-menubar", &show_menubar,
                      NULL);
 
-       return show_app_menu;
+       return show_app_menu && !show_menubar;
 }
 
 /* ex:set ts=8 noet: */


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