summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2015-03-06 11:08:04 +0100
committerAndy Shaw <andy.shaw@digia.com>2015-03-06 10:38:51 +0000
commita9a41961c6ef3627a8dd2bf69664c13d9cb20568 (patch)
tree3e4c99cee5b14790266acaa950698f33828de505 /src/plugins/platforms
parent143350c8767a54469721e5489f5d62a3ab34e264 (diff)
Win QPA: Pass in the top level setting instead of relying on isTopLevel()
When updateDropSite() is called then most of the time calling window()->isTopLevel() is enough. But in a case like while the window is being reparented it cannot be trusted. So we pass it as a variable so that it is possible to give it the correct information when it is being called. Task-number: QTBUG-39739 Change-Id: I77a7ceeaf78e89b1f65a10d60df86088b35e0fe5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp10
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 0216b40e3e..54d1908e8b 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -933,7 +933,7 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data)
setFlag(OpenGL_ES2);
}
#endif // QT_NO_OPENGL
- updateDropSite();
+ updateDropSite(window()->isTopLevel());
#ifndef Q_OS_WINCE
if ((QWindowsContext::instance()->systemInfo() & QWindowsContext::SI_SupportsTouch)
@@ -1020,10 +1020,10 @@ void QWindowsWindow::destroyWindow()
}
}
-void QWindowsWindow::updateDropSite()
+void QWindowsWindow::updateDropSite(bool topLevel)
{
bool enabled = false;
- if (window()->isTopLevel()) {
+ if (topLevel) {
switch (window()->type()) {
case Qt::Window:
case Qt::Dialog:
@@ -1306,7 +1306,7 @@ void QWindowsWindow::setParent_sys(const QPlatformWindow *parent)
if (wasTopLevel != isTopLevel) {
setDropSiteEnabled(false);
setWindowFlags_sys(window()->flags(), unsigned(isTopLevel ? WindowCreationData::ForceTopLevel : WindowCreationData::ForceChild));
- updateDropSite();
+ updateDropSite(isTopLevel);
}
}
}
@@ -1561,7 +1561,7 @@ void QWindowsWindow::setWindowFlags(Qt::WindowFlags flags)
m_data.flags = flags;
if (m_data.hwnd) {
m_data = setWindowFlags_sys(flags);
- updateDropSite();
+ updateDropSite(window()->isTopLevel());
}
}
// When switching to a frameless window, geometry
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
index 6d6d473ccd..0b42e77ecd 100644
--- a/src/plugins/platforms/windows/qwindowswindow.h
+++ b/src/plugins/platforms/windows/qwindowswindow.h
@@ -274,7 +274,7 @@ private:
void destroyWindow();
inline bool isDropSiteEnabled() const { return m_dropTarget != 0; }
void setDropSiteEnabled(bool enabled);
- void updateDropSite();
+ void updateDropSite(bool topLevel);
void handleGeometryChange();
void handleWindowStateChange(Qt::WindowState state);
inline void destroyIcon();