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>
bb10
Val Doroshchuk 2018-09-19 13:56:50 +02:00 committed by VaL Doroshchuk
parent 2a1c368c87
commit 2e86b652b7
1 changed files with 1 additions and 1 deletions

View File

@ -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;