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
parent
2a1c368c87
commit
2e86b652b7
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue