From ca7e1d8bd133e0d21012e9c7416ebde9d01d2246 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 29 Oct 2017 22:44:10 +0100 Subject: [PATCH] Remove manual wxProgressDialog centering code This is not necessary any longer now that we use the correct parent for the dialog window, the task dialog is centered automatically. And unlike our own code, comctl32.dll code always puts the dialog fully on one monitor instead of making it span two of them if the parent window does. --- src/msw/progdlg.cpp | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/msw/progdlg.cpp b/src/msw/progdlg.cpp index 69ec144ebd..3545ba0700 100644 --- a/src/msw/progdlg.cpp +++ b/src/msw/progdlg.cpp @@ -1128,27 +1128,6 @@ wxProgressDialogTaskRunner::TaskDialogCallbackProc 0, MAKELPARAM(0, sharedData->m_range) ); - // We always create this task dialog with NULL parent because our - // parent in wx sense is a window created from a different thread - // and so can't be used as our real parent. However we still center - // this window on the parent one as the task dialogs do with their - // real parent usually. - if ( sharedData->m_parent ) - { - wxRect rect(wxRectFromRECT(wxGetWindowRect(hwnd))); - rect = rect.CentreIn(sharedData->m_parent->GetRect()); - ::SetWindowPos(hwnd, - NULL, - rect.x, - rect.y, - -1, - -1, - SWP_NOACTIVATE | - SWP_NOOWNERZORDER | - SWP_NOSIZE | - SWP_NOZORDER); - } - // If we can't be aborted, the "Close" button will only be enabled // when the progress ends (and not even then with wxPD_AUTO_HIDE). if ( !(sharedData->m_style & wxPD_CAN_ABORT) )