X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bcd055ae108a30299fa278f3fe774f52414eb3df..09e48f0b1917db7e455f28c2c9ed661d39e9ab65:/src/motif/app.cpp diff --git a/src/motif/app.cpp b/src/motif/app.cpp index d1899f78a6..fa1fd15f66 100644 --- a/src/motif/app.cpp +++ b/src/motif/app.cpp @@ -736,8 +736,18 @@ void wxExit() } // Yield to other processes + +static bool gs_inYield = FALSE; + bool wxYield() { +#ifdef __WXDEBUG__ + if (gs_inYield) + wxFAIL_MSG( wxT("wxYield called recursively" ) ); +#endif + + gs_inYield = TRUE; + while (wxTheApp && wxTheApp->Pending()) wxTheApp->Dispatch(); @@ -746,9 +756,21 @@ bool wxYield() XtAppProcessEvent((XtAppContext) wxTheApp->GetAppContext(), XtIMAll); #endif + gs_inYield = FALSE; + return TRUE; } +// Yield to incoming messages; but fail silently if recursion is detected. +bool wxYieldIfNeeded() +{ + if (gs_inYield) + return FALSE; + + return wxYield(); +} + + // TODO use XmGetPixmap (?) to get the really standard icons! #include "wx/generic/info.xpm"