From d1e57312c2be1637c8c52feff1b9f072d828ca48 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 13 Jan 2018 17:41:16 +0100 Subject: [PATCH] Revert "Don't call wxWakeUpIdle() with a lock in wxProgressDialog" This reverts commit d26758044c55c0111ccd5e2c4d161f74c06d1771 which was a workaround for the problem of wxWakeUpIdle() dispatching events, as this is not the case any more after the latest changes. --- src/msw/progdlg.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/msw/progdlg.cpp b/src/msw/progdlg.cpp index 2f1131a5dc..46416402c5 100644 --- a/src/msw/progdlg.cpp +++ b/src/msw/progdlg.cpp @@ -1133,18 +1133,6 @@ wxProgressDialogTaskRunner::TaskDialogCallbackProc LONG_PTR dwRefData ) { - if ( uNotification == TDN_CREATED ) - { - // The main thread may be sitting in an event dispatching loop waiting - // for this dialog to be shown, so make sure it does wake up now that - // it is. Notice that we must do it from here and not from inside the - // block below in which sharedData is locked as otherwise we could - // deadlock if wxWakeUpIdle() dispatched some event which tried to call - // any of wxProgressDialog methods, which also lock this data, from the - // main thread. - wxWakeUpIdle(); - } - bool endDialog = false; // Block for shared data critical section. @@ -1160,6 +1148,10 @@ wxProgressDialogTaskRunner::TaskDialogCallbackProc // Store the HWND for the main thread use. sharedData->m_hwnd = hwnd; + // The main thread is sitting in an event dispatching loop waiting + // for this dialog to be shown, so make sure it does get an event. + wxWakeUpIdle(); + // Set the maximum value and disable Close button. ::SendMessage( hwnd, TDM_SET_PROGRESS_BAR_RANGE,