summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
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);