]> git.saurik.com Git - wxWidgets.git/commitdiff
make it possible to override desktop detection using gtk.desktop system option
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 3 May 2007 13:46:33 +0000 (13:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 3 May 2007 13:46:33 +0000 (13:46 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45786 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/sysopt.tex
src/gtk/utilsgtk.cpp

index 12b8b11bf8cf6322c62e6316222184c1c2694832..91009e1a7c35cf6bb507b56eac5fe23ae2fdc69c 100644 (file)
@@ -44,6 +44,8 @@ level windows is currently supported, however this may sometimes fail and this
 option allows to override the automatic detection. Setting it to $1$ makes the
 transparency be always available (setting it can still fail, of course) and
 setting it to $0$ makes it always unavailable.}
+\twocolitem{gtk.desktop}{This option can be set to override the default desktop
+environment determination. Supported values are \texttt{GNOME} and \texttt{KDE}.}
 \end{twocollist}
 
 \wxheading{Mac}
index faf8184ba8e9929b55fd677621740d445f084ef7..617a497427352fc3af1d7fa5407193cf737693e4 100644 (file)
@@ -21,6 +21,7 @@
 #include "wx/apptrait.h"
 
 #include "wx/process.h"
+#include "wx/sysopt.h"
 
 #include "wx/unix/execute.h"
 
@@ -474,17 +475,20 @@ bool wxGUIAppTraits::ShowAssertDialog(const wxString& msg)
 
 wxString wxGUIAppTraits::GetDesktopEnvironment() const
 {
+    wxString de = wxSystemOptions::GetOption(_T("gtk.desktop"));
+    if ( de.empty() )
+    {
 #if wxUSE_DETECT_SM
-    static const wxString SM = GetSM();
-
-    if (SM == wxT("GnomeSM"))
-        return wxT("GNOME");
+        static const wxString s_SM = GetSM();
 
-    if (SM == wxT("KDE"))
-        return wxT("KDE");
+        if (s_SM == wxT("GnomeSM"))
+            de = wxT("GNOME");
+        else if (s_SM == wxT("KDE"))
+            de = wxT("KDE");
+    }
 #endif // wxUSE_DETECT_SM
 
-    return wxEmptyString;
+    return de;
 }
 
 #ifdef __WXGTK26__