X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/366e8ae67583e44f719d1c2fabb3a24eb3bda5b3..6500c0b134e57412145f72b27396dc573adf0844:/src/x11/app.cpp diff --git a/src/x11/app.cpp b/src/x11/app.cpp index c7b517a62d..b42979accb 100644 --- a/src/x11/app.cpp +++ b/src/x11/app.cpp @@ -388,13 +388,10 @@ wxAppInitializerFunction wxAppBase::m_appInitFn = (wxAppInitializerFunction) NUL wxApp::wxApp() { - m_topWindow = NULL; - wxTheApp = this; - m_className = ""; - m_wantDebugOutput = TRUE ; - m_appName = ""; + // TODO: parse the command line argc = 0; argv = NULL; + m_mainColormap = (WXColormap) NULL; m_topLevelWidget = (WXWindow) NULL; m_maxRequestSize = 0; @@ -571,9 +568,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event) { printf( "GraphicExpose event\n" ); - wxLogTrace( _T("expose"), _T("GraphicsExpose from %s"), win->GetName().c_str(), - event->xgraphicsexpose.x, event->xgraphicsexpose.y, - event->xgraphicsexpose.width, event->xgraphicsexpose.height); + wxLogTrace( _T("expose"), _T("GraphicsExpose from %s"), win->GetName().c_str()); win->GetUpdateRegion().Union( event->xgraphicsexpose.x, event->xgraphicsexpose.y, event->xgraphicsexpose.width, event->xgraphicsexpose.height); @@ -1179,45 +1174,52 @@ void wxExit() bool wxApp::Yield(bool onlyIfNeeded) { - bool s_inYield = FALSE; - - if ( s_inYield ) + // Sometimes only 2 yields seem + // to do the trick, e.g. in the + // progress dialog + int i; + for (i = 0; i < 2; i++) { - if ( !onlyIfNeeded ) + bool s_inYield = FALSE; + + if ( s_inYield ) { - wxFAIL_MSG( wxT("wxYield called recursively" ) ); - } + if ( !onlyIfNeeded ) + { + wxFAIL_MSG( wxT("wxYield called recursively" ) ); + } - return FALSE; - } + return FALSE; + } - s_inYield = TRUE; + s_inYield = TRUE; - // Make sure we have an event loop object, - // or Pending/Dispatch will fail - wxEventLoop* eventLoop = wxEventLoop::GetActive(); - wxEventLoop* newEventLoop = NULL; - if (!eventLoop) - { - newEventLoop = new wxEventLoop; - wxEventLoop::SetActive(newEventLoop); - } + // Make sure we have an event loop object, + // or Pending/Dispatch will fail + wxEventLoop* eventLoop = wxEventLoop::GetActive(); + wxEventLoop* newEventLoop = NULL; + if (!eventLoop) + { + newEventLoop = new wxEventLoop; + wxEventLoop::SetActive(newEventLoop); + } - while (wxTheApp && wxTheApp->Pending()) - wxTheApp->Dispatch(); + while (wxTheApp && wxTheApp->Pending()) + wxTheApp->Dispatch(); #if wxUSE_TIMER - wxTimer::NotifyTimers(); + wxTimer::NotifyTimers(); #endif - ProcessIdle(); + ProcessIdle(); - if (newEventLoop) - { - wxEventLoop::SetActive(NULL); - delete newEventLoop; - } + if (newEventLoop) + { + wxEventLoop::SetActive(NULL); + delete newEventLoop; + } - s_inYield = FALSE; + s_inYield = FALSE; + } return TRUE; }