diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-01-16 01:22:45 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-01-16 01:22:45 +0100 |
commit | 7075e291998612a3c0a530bb37a515dd07739e28 (patch) | |
tree | 4e1992498d82ee3f6f92fd6d42754c92928dd581 /src/plugins/platforms/windows/qwindowswindow.cpp | |
parent | 1161a8a62907796ea45b1877bec31e66aeef77f6 (diff) | |
parent | 3d9a40038f01bc2a3df0027a9be04e7fa3ce3850 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
src/widgets/styles/qstyleanimation.cpp
Change-Id: Iae570895be6544de80f9c1ec309d1a08c59daff8
Diffstat (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 50fd7a0792..23ebd6bd9e 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -267,7 +267,7 @@ static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, qreal level) struct WindowCreationData { typedef QWindowsWindow::WindowData WindowData; - enum Flags { ForceChild = 0x1 }; + enum Flags { ForceChild = 0x1, ForceTopLevel = 0x2 }; WindowCreationData() : parentHandle(0), type(Qt::Widget), style(0), exStyle(0), topLevel(false), popup(false), dialog(false), desktop(false), @@ -319,7 +319,13 @@ void WindowCreationData::fromWindow(const QWindow *w, const Qt::WindowFlags flag parentHandle = (HWND)prop.value<WId>(); } - topLevel = ((creationFlags & ForceChild) || embedded) ? false : w->isTopLevel(); + if (creationFlags & ForceChild) { + topLevel = false; + } else if (creationFlags & ForceTopLevel) { + topLevel = true; + } else { + topLevel = w->isTopLevel(); + } if (topLevel && flags == 1) { flags |= Qt::WindowTitleHint|Qt::WindowSystemMenuHint|Qt::WindowMinimizeButtonHint @@ -1022,10 +1028,9 @@ void QWindowsWindow::setParent_sys(const QPlatformWindow *parent) const // WS_CHILD/WS_POPUP must be manually set/cleared in addition // to dialog frames, etc (see SetParent() ) if the top level state changes. - if (wasTopLevel != isTopLevel) { - const unsigned flags = isTopLevel ? unsigned(0) : unsigned(WindowCreationData::ForceChild); - setWindowFlags_sys(window()->flags(), flags); - } + // Force toplevel state as QWindow::isTopLevel cannot be relied upon here. + if (wasTopLevel != isTopLevel) + setWindowFlags_sys(window()->flags(), unsigned(isTopLevel ? WindowCreationData::ForceTopLevel : WindowCreationData::ForceChild)); } } |