X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/34a34b020f1c8defacb299a0fa5c480fa65b8597..10f2222ca37dba7e4faf791e48f2aca8110c43c6:/src/gtk/app.cpp diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index 6b9ddf198c..4d25eb73de 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -136,9 +136,11 @@ bool wxApp::Yield(bool onlyIfNeeded) // never finish. wxTheApp->RemoveIdleTag(); +#if wxUSE_LOG // disable log flushing from here because a call to wxYield() shouldn't // normally result in message boxes popping up &c wxLog::Suspend(); +#endif while (gtk_events_pending()) gtk_main_iteration(); @@ -151,8 +153,10 @@ bool wxApp::Yield(bool onlyIfNeeded) // return value of Processidle(). ProcessIdle(); +#if wxUSE_LOG // let the logs be flashed again wxLog::Resume(); +#endif wxIsInsideYield = FALSE; @@ -606,6 +610,34 @@ bool wxApp::Initialize(int& argc, wxChar **argv) wxConvCurrent = (wxMBConv*) NULL; #endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T +#ifdef __WXGTK20__ + // decide which conversion to use for the file names + + // (1) this variable exists for the sole purpose of specifying the encoding + // of the filenames for GTK+ programs, so use it if it is set + wxString encName(wxGetenv(_T("G_FILENAME_ENCODING"))); + if (encName == _T("@locale")) + encName.clear(); + encName.MakeUpper(); +#if wxUSE_INTL + if (encName.empty()) + { + // (2) if a non default locale is set, assume that the user wants his + // filenames in this locale too + encName = wxLocale::GetSystemEncodingName().Upper(); + // (3) finally use UTF-8 by default + if (encName.empty() || encName == _T("US-ASCII")) + encName = _T("UTF-8"); + wxSetEnv(_T("G_FILENAME_ENCODING"), encName); + } +#else + if (encName.empty()) + encName = _T("UTF-8"); +#endif // wxUSE_INTL + static wxConvBrokenFileNames fileconv(encName); + wxConvFileName = &fileconv; +#endif // __WXGTK20__ + #if wxUSE_UNICODE // gtk_init() wants UTF-8, not wchar_t, so convert int i;