]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/app.cpp
Add doc for wxGraphicsContext.Create(), which is a lightweight context with no target...
[wxWidgets.git] / src / gtk / app.cpp
index 63ed6f13b3a6e653ef01aa6306e5c34e9b641360..3754531c01719eec088d7256fea9fee7700b4315 100644 (file)
@@ -529,6 +529,25 @@ void wxGUIAppTraits::MutexGuiLeave()
 }
 #endif // wxUSE_THREADS
 
 }
 #endif // wxUSE_THREADS
 
+/* static */
+bool wxApp::GTKIsUsingGlobalMenu()
+{
+    static int s_isUsingGlobalMenu = -1;
+    if ( s_isUsingGlobalMenu == -1 )
+    {
+        // Currently we just check for this environment variable because this
+        // is how support for the global menu is implemented under Ubuntu.
+        //
+        // If we ever get false positives, we could also check for
+        // XDG_CURRENT_DESKTOP env var being set to "Unity".
+        wxString proxy;
+        s_isUsingGlobalMenu = wxGetEnv("UBUNTU_MENUPROXY", &proxy) &&
+                                !proxy.empty() && proxy != "0";
+    }
+
+    return s_isUsingGlobalMenu == 1;
+}
+
 #if wxUSE_LIBHILDON || wxUSE_LIBHILDON2
 // Maemo-specific method: get the main program object
 HildonProgram *wxApp::GetHildonProgram()
 #if wxUSE_LIBHILDON || wxUSE_LIBHILDON2
 // Maemo-specific method: get the main program object
 HildonProgram *wxApp::GetHildonProgram()