diff --git a/src/FloatingDragPreview.cpp b/src/FloatingDragPreview.cpp index 3d3cc10..cd2e534 100644 --- a/src/FloatingDragPreview.cpp +++ b/src/FloatingDragPreview.cpp @@ -123,7 +123,19 @@ void FloatingDragPreviewPrivate::updateDropOverlays(const QPoint &GlobalPos) int VisibleDockAreas = TopContainer->visibleDockAreaCount(); ContainerOverlay->setAllowedAreas( VisibleDockAreas > 1 ? OuterDockAreas : AllDockAreas); - DockWidgetArea ContainerArea = ContainerOverlay->showOverlay(TopContainer); + + DockWidgetArea ContainerArea = InvalidDockWidgetArea; + // If there is only one single visible dock area in a container, then + // it does not make sense to show a dock overlay because the dock area + // would be removed and inserted at the same position + if (VisibleDockAreas <= 1) + { + ContainerOverlay->hideOverlay(); + } + else + { + ContainerArea = ContainerOverlay->showOverlay(TopContainer); + } ContainerOverlay->enableDropPreview(ContainerArea != InvalidDockWidgetArea); auto DockArea = TopContainer->dockAreaAt(GlobalPos); if (DockArea && DockArea->isVisible() && VisibleDockAreas > 0 && DockArea != ContentSourceArea) @@ -151,14 +163,6 @@ void FloatingDragPreviewPrivate::updateDropOverlays(const QPoint &GlobalPos) else { DockAreaOverlay->hideOverlay(); - // If there is only one single visible dock area in a container, then - // it does not make sense to show a dock overlay because the dock area - // would be removed and inserted at the same position - if (VisibleDockAreas <= 1) - { - ContainerOverlay->hideOverlay(); - } - if (DockArea == ContentSourceArea && InvalidDockWidgetArea == ContainerDropArea) { DropContainer = nullptr;