diff options
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 6894062d61..b5522c1f90 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1273,6 +1273,12 @@ void QWindowsWindow::updateTransientParent() const if (const QWindowsWindow *tw = QWindowsWindow::windowsWindowOf(tp)) if (!tw->testFlag(WithinDestroy)) // Prevent destruction by parent window (QTBUG-35499, QTBUG-36666) newTransientParent = tw->handle(); + + // QTSOLBUG-71: When using the MFC/winmigrate solution, it is possible that a child + // window is found, which can cause issues with modality. Loop up to top level. + while (newTransientParent && (GetWindowLongPtr(newTransientParent, GWL_STYLE) & WS_CHILD) != 0) + newTransientParent = GetParent(newTransientParent); + if (newTransientParent != oldTransientParent) SetWindowLongPtr(m_data.hwnd, GWL_HWNDPARENT, LONG_PTR(newTransientParent)); } |