diff --git a/src/FloatingDragPreview.cpp b/src/FloatingDragPreview.cpp index a48611d..3bfc1aa 100644 --- a/src/FloatingDragPreview.cpp +++ b/src/FloatingDragPreview.cpp @@ -72,6 +72,26 @@ struct FloatingDragPreviewPrivate * outside of any drop area */ void createFloatingWidget(); + + /** + * Returns true, if the content is floatable + */ + bool isContentFloatable() const + { + CDockWidget* DockWidget = qobject_cast(Content); + if (DockWidget && DockWidget->features().testFlag(CDockWidget::DockWidgetFloatable)) + { + return true; + } + + CDockAreaWidget* DockArea = qobject_cast(Content); + if (DockArea && DockArea->features().testFlag(CDockWidget::DockWidgetFloatable)) + { + return true; + } + + return false; + } }; // struct LedArrayPanelPrivate @@ -328,10 +348,18 @@ void CFloatingDragPreview::finishDragging() { ADS_PRINT("CFloatingDragPreview::finishDragging"); - cleanupAutoHideContainerWidget(); - auto DockDropArea = d->DockManager->dockAreaOverlay()->visibleDropAreaUnderCursor(); auto ContainerDropArea = d->DockManager->containerOverlay()->visibleDropAreaUnderCursor(); + bool ValidDropArea = (DockDropArea != InvalidDockWidgetArea) || (ContainerDropArea != InvalidDockWidgetArea); + bool FloatingRequested = !d->DropContainer && !ValidDropArea; + + // Non floatable auto hide widgets should stay in its current auto hide + // state if they are dragged into a floating window + if (!FloatingRequested || d->isContentFloatable()) + { + cleanupAutoHideContainerWidget(); + } + if (!d->DropContainer) { d->createFloatingWidget();