From a6b9a82e9cfa902ad39d63316b512b3caf526d22 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Sun, 31 Jan 2021 12:59:02 +0000 Subject: [PATCH] Fix crash when hosting QQuickWidget There's no need to check if invisible widgets are candidates for docking. There's usually no downside either, except that QQuickWidget is very sensitive with when its platform window is created, so don't force the creation. Will cherry-pick to 1.2 if no regression is found Fixes #150 --- Changelog | 1 + src/private/DragController.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Changelog b/Changelog index 86ecf413..50c8aeaa 100644 --- a/Changelog +++ b/Changelog @@ -13,6 +13,7 @@ - Fixed drag offset when dragging too fast with mouse - Fixed bug where last tab index position wouldn't be remembered in case user had manually reordered tabs (#154) + - Fixed crash when hosting a QQuickWidget (#150) * v1.2.1 (unreleased) - Support for resizing dock widgets when they are in overlay/popup mode (autohide/sidebar feature) diff --git a/src/private/DragController.cpp b/src/private/DragController.cpp index 3f133859..887c0a05 100644 --- a/src/private/DragController.cpp +++ b/src/private/DragController.cpp @@ -648,6 +648,10 @@ static QWidgetOrQuick *qtTopLevelForHWND(HWND hwnd) { const QList windows = qApp->topLevelWindows(); for (QWindow *window : windows) { + if (!window->isVisible()) { + continue; + } + if (hwnd == (HWND)window->winId()) { return DockRegistry::self()->topLevelForHandle(window); }