From 2e86b652b789374ed9e0ddb15b0f60dd24b99fe8 Mon Sep 17 00:00:00 2001 From: Val Doroshchuk Date: Wed, 19 Sep 2018 13:56:50 +0200 Subject: 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 --- src/gui/kernel/qsimpledrag.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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(w)) + if (w->isVisible() && w->handle() && w->geometry().contains(pos) && !qobject_cast(w)) return w; } return 0; -- cgit v1.2.3