X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/afb7489128719ac8999b037d49a0c28636d59558..c4b10e41c7c275927fcc9999f81b6f65eadc7d31:/src/msw/utils.cpp diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 1433988261..3dc34fdc7e 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -301,7 +301,23 @@ static wxTimer *wxTheSleepTimer = NULL; void wxUsleep(unsigned long milliseconds) { +#ifdef __WIN32__ ::Sleep(milliseconds); +#else + if (inTimer) + return; + + wxTheSleepTimer = new wxSleepTimer; + inTimer = TRUE; + wxTheSleepTimer->Start(milliseconds); + while (inTimer) + { + if (wxTheApp->Pending()) + wxTheApp->Dispatch(); + } + delete wxTheSleepTimer; + wxTheSleepTimer = NULL; +#endif } void wxSleep(int nSecs)