summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorMauro Persano <mauro.persano@kdab.com>2018-07-23 12:41:08 -0300
committerMauro Persano <mauro.persano@kdab.com>2018-08-08 17:19:17 +0000
commitd25d11e6e2fd08f117825a06f1bdf3928d057fb8 (patch)
tree6ba4400128f02558595596aa941b4eef8674d3d0 /src/plugins
parentb4977a332b0086d1dd14e829891427d27f5eec54 (diff)
Windows QPA: fix transientParentHwnd
QWindowsWindow::updateTransientParent retrieves the handle of the topmost owner window, not that of the immediate owner window (which corresponds to the handle of transient parent window). Task-number: QTBUG-69620 Change-Id: I1433098e8e93832d97508ee1782f88ccc000ee3a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 45788fec15..528927b0fb 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1382,16 +1382,6 @@ QPoint QWindowsWindow::mapFromGlobal(const QPoint &pos) const
return m_data.hwnd ? QWindowsGeometryHint::mapFromGlobal(m_data.hwnd, pos) : pos;
}
-static inline HWND transientParentHwnd(HWND hwnd)
-{
- if (GetAncestor(hwnd, GA_PARENT) == GetDesktopWindow()) {
- const HWND rootOwnerHwnd = GetAncestor(hwnd, GA_ROOTOWNER);
- if (rootOwnerHwnd != hwnd) // May return itself for toplevels.
- return rootOwnerHwnd;
- }
- return 0;
-}
-
// Update the transient parent for a toplevel window. The concept does not
// really exist on Windows, the relationship is set by passing a parent along with !WS_CHILD
// to window creation or by setting the parent using GWL_HWNDPARENT (as opposed to
@@ -1406,7 +1396,7 @@ void QWindowsWindow::updateTransientParent() const
if (window()->type() == Qt::Popup)
return; // QTBUG-34503, // a popup stays on top, no parent, see also WindowCreationData::fromWindow().
// Update transient parent.
- const HWND oldTransientParent = transientParentHwnd(m_data.hwnd);
+ const HWND oldTransientParent = GetWindow(m_data.hwnd, GW_OWNER);
HWND newTransientParent = 0;
if (const QWindow *tp = window()->transientParent())
if (const QWindowsWindow *tw = QWindowsWindow::windowsWindowOf(tp))