X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d3a0a0eeab1965fcf85d15123c32a8f3a1900351..092793cb6d3de368ec51ed0e38faeed3989f2f33:/src/gtk/utilsgtk.cpp diff --git a/src/gtk/utilsgtk.cpp b/src/gtk/utilsgtk.cpp index c0d0309f95..445a5f3bb7 100644 --- a/src/gtk/utilsgtk.cpp +++ b/src/gtk/utilsgtk.cpp @@ -21,10 +21,12 @@ #include "wx/apptrait.h" #include "wx/process.h" +#include "wx/sysopt.h" #include "wx/unix/execute.h" #include "wx/gtk/private/timer.h" +#include "wx/evtloop.h" #ifdef __WXDEBUG__ #include "wx/gtk/assertdlg_gtk.h" @@ -332,15 +334,19 @@ static wxString GetSM() if ( !dpy ) return wxEmptyString; + char smerr[256]; char *client_id; SmcConn smc_conn = SmcOpenConnection(NULL, NULL, 999, 999, 0 /* mask */, NULL /* callbacks */, NULL, &client_id, - 0, NULL); + WXSIZEOF(smerr), smerr); if ( !smc_conn ) + { + wxLogWarning(_("Failed to connect to session manager: %s"), smerr); return wxEmptyString; + } char *vendor = SmcVendor(smc_conn); wxString ret = wxString::FromAscii( vendor ); @@ -358,10 +364,17 @@ static wxString GetSM() // wxGUIAppTraits //----------------------------------------------------------------------------- +wxEventLoopBase *wxGUIAppTraits::CreateEventLoop() +{ + return new wxEventLoop(); +} + + #if wxUSE_INTL void wxGUIAppTraits::SetLocale() { gtk_set_locale(); + wxUpdateLocaleIsUtf8(); } #endif @@ -469,17 +482,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 - const wxString SM = GetSM(); + static const wxString s_SM = GetSM(); - if (SM == wxT("GnomeSM")) - return wxT("GNOME"); - - 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__