X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6a088435b32d8e186d1efe1d95ddb56e96fcfcf3..18d2e17080a0bea4b85e0ad7223cfc6bcdab0e1e:/src/msw/dialog.cpp diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index 2a01b7671d..4a72ff9560 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -575,6 +575,18 @@ void wxDialog::DoShowModal() bool wxDialog::Show(bool show) { + // The following is required when the parent has been disabled, + // (modal dialogs, or modeless dialogs with disabling such as wxProgressDialog). + // Otherwise the parent disappears behind other windows when the dialog is hidden. + if (!show) + { + HWND hwndParent = GetParent() ? (HWND) GetParent()->GetHWND() : (HWND)NULL; + if ( hwndParent ) + { + ::BringWindowToTop(hwndParent); + } + } + if ( !wxDialogBase::Show(show) ) { // nothing to do @@ -620,12 +632,6 @@ void wxDialog::EndModal(int retCode) { SetReturnCode(retCode); - HWND hwndParent = GetParent() ? (HWND) GetParent()->GetHWND() : (HWND)NULL; - if ( hwndParent ) - { - ::BringWindowToTop(hwndParent); - } - Show(FALSE); }