summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2012-08-16 13:03:32 +0300
committerQt by Nokia <qt-info@nokia.com>2012-08-17 12:21:34 +0200
commit0d897a7fb6e2b2d6c2e8fe31aab1837ebd234b58 (patch)
tree188e4ff529101dba32c722a031962b76e90c6823 /src/plugins
parent30f343284585b96714696fce676c6f23596ae960 (diff)
Fix setParent_sys() to use native methods when checking for toplevel
QWindowsWindow::setParent_sys() was checking if window was toplevel using non-native method, which caused wrong result in some cases involving native windows. Changed the toplevel check to utilize native method instead. Task-number: QTBUG-26826 Change-Id: I72ca17c53c1ed7611f141cee17b2edaaa80c6c17 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 773d3f7102..8f376162ef 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -903,8 +903,15 @@ void QWindowsWindow::setParent_sys(const QPlatformWindow *parent) const
}
+ // NULL handle means desktop window, which also has its proper handle -> disambiguate
+ HWND desktopHwnd = GetDesktopWindow();
+ if (oldParentHWND == desktopHwnd)
+ oldParentHWND = 0;
+ if (newParentHWND == desktopHwnd)
+ newParentHWND = 0;
+
if (newParentHWND != oldParentHWND) {
- const bool wasTopLevel = window()->isTopLevel();
+ const bool wasTopLevel = oldParentHWND == 0;
const bool isTopLevel = newParentHWND == 0;
setFlag(WithinSetParent);