summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qsimpledrag.cpp
diff options
context:
space:
mode:
authorVal Doroshchuk <valentyn.doroshchuk@qt.io>2018-09-19 13:56:50 +0200
committerVaL Doroshchuk <valentyn.doroshchuk@qt.io>2018-11-29 13:14:14 +0000
commit2e86b652b789374ed9e0ddb15b0f60dd24b99fe8 (patch)
treea0e16aa3c243695a985cd884be725b3861511592 /src/gui/kernel/qsimpledrag.cpp
parent2a1c368c873afe9b222c759d4348b93beafca8ea (diff)
Fix crash in QSimpleDrag when no platform window
No need to return top level window if it was not created. It means no platform resources have been allocated. Events might not be delivered if the wrong window is returned. Fixes: QTBUG-70544 Change-Id: I43462974f70871470f7b7490dc2b3c08846f77b1 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/gui/kernel/qsimpledrag.cpp')
-rw-r--r--src/gui/kernel/qsimpledrag.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp
index 2611dc8580..9aab332ef5 100644
--- a/src/gui/kernel/qsimpledrag.cpp
+++ b/src/gui/kernel/qsimpledrag.cpp
@@ -74,7 +74,7 @@ static QWindow* topLevelAt(const QPoint &pos)
QWindowList list = QGuiApplication::topLevelWindows();
for (int i = list.count()-1; i >= 0; --i) {
QWindow *w = list.at(i);
- if (w->isVisible() && w->geometry().contains(pos) && !qobject_cast<QShapedPixmapWindow*>(w))
+ if (w->isVisible() && w->handle() && w->geometry().contains(pos) && !qobject_cast<QShapedPixmapWindow*>(w))
return w;
}
return 0;