From: Jouk Jansen Date: Tue, 27 Aug 2013 11:46:13 +0000 (+0000) Subject: revert nested event loop support for wxGTK1 because it causes applications hangs X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/67afffcd05e53e20503b7b64215b6c272ac75e47 revert nested event loop support for wxGTK1 because it causes applications hangs git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74711 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk1/evtloop.cpp b/src/gtk1/evtloop.cpp index 39f129b610..d3eb76ce49 100644 --- a/src/gtk1/evtloop.cpp +++ b/src/gtk1/evtloop.cpp @@ -74,9 +74,18 @@ int wxGUIEventLoop::DoRun() // event loops. For example, inside this event loop, we may recieve // Exit() for a different event loop (which we are currently inside of) // That Exit() will cause this gtk_main() to exit so we need to re-enter it. - while ( !m_shouldExit ) +#if 0 + // changed by JJ + // this code was intended to support nested event loops. However, + // exiting a dialog will result in a application hang (because + // gtk_main_quit is called when closing the dialog????) + // So for the moment this code is disabled and nested event loops + // probably fail for wxGTK1 + while ( !m_shouldExit ) { - gtk_main(); +#endif + gtk_main(); +#if 0 } // Force the enclosing event loop to also exit to see if it is done @@ -89,6 +98,7 @@ int wxGUIEventLoop::DoRun() { gtk_main_quit(); } +#endif OnExit(); @@ -182,3 +192,24 @@ bool wxGUIEventLoop::YieldFor(long eventsToProcess) return true; } + +class wxGUIEventLoopSourcesManager : public wxEventLoopSourcesManagerBase +{ + public: + wxEventLoopSource * + AddSourceForFD(int WXUNUSED(fd), + wxEventLoopSourceHandler* WXUNUSED(handler), + int WXUNUSED(flags)) + { + wxFAIL_MSG("Monitoring FDs in the main loop is not implemented in wxGTK1"); + + return NULL; + } +}; + +wxEventLoopSourcesManagerBase* wxGUIAppTraits::GetEventLoopSourcesManager() +{ + static wxGUIEventLoopSourcesManager s_eventLoopSourcesManager; + + return &s_eventLoopSourcesManager; +}