X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/48733d474148267a7e1008b2bd019451d632ce17..63b3dc58be6a03cd617668f3a1a97cbfb3f95438:/src/msw/app.cpp diff --git a/src/msw/app.cpp b/src/msw/app.cpp index e071002e1b..6ba5c68d00 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -25,6 +25,7 @@ #endif #ifndef WX_PRECOMP + #include "wx/dynarray.h" #include "wx/frame.h" #include "wx/app.h" #include "wx/utils.h" @@ -38,7 +39,6 @@ #include "wx/dialog.h" #include "wx/msgdlg.h" #include "wx/intl.h" - #include "wx/dynarray.h" #include "wx/wxchar.h" #include "wx/icon.h" #include "wx/log.h" @@ -48,6 +48,7 @@ #include "wx/filename.h" #include "wx/module.h" #include "wx/dynlib.h" +#include "wx/evtloop.h" #include "wx/msw/private.h" #include "wx/msw/ole/oleutils.h" @@ -218,7 +219,14 @@ bool wxGUIAppTraits::DoMessageFromThreadWait() { // we should return false only if the app should exit, i.e. only if // Dispatch() determines that the main event loop should terminate - return !wxTheApp || wxTheApp->Dispatch(); + wxEventLoop *evtLoop = wxEventLoop::GetActive(); + if ( !evtLoop || !evtLoop->Pending() ) + { + // no events means no quit event + return true; + } + + return evtLoop->Dispatch(); } wxToolkitInfo& wxGUIAppTraits::GetToolkitInfo() @@ -305,7 +313,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv) // fails to find a device. SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX); #endif - + wxOleInitialize(); RegisterWindowClasses(); @@ -583,7 +591,7 @@ int wxApp::GetComCtl32Version() // we're prepared to handle the errors wxLogNull noLog; - + #if wxUSE_DYNLIB_CLASS // do we have it? wxDynamicLibrary dllComCtl32(_T("comctl32.dll"), wxDL_VERBATIM); @@ -642,7 +650,7 @@ int wxApp::GetComCtl32Version() } } } -#endif +#endif } return s_verComCtl32; @@ -748,8 +756,6 @@ terminate the program,\r\n\ #if WXWIN_COMPATIBILITY_2_4 -#include "wx/evtloop.h" - void wxApp::DoMessage(WXMSG *pMsg) { wxEventLoop *evtLoop = wxEventLoop::GetActive();