Skip to content

Commit 62ce9dc

Browse files
Fixed small bug in FloatingDragPreview that caused flashing of hidden overlay when dragging the last visible dock widget in non opaque docking mode
1 parent 985d164 commit 62ce9dc

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/FloatingDragPreview.cpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,19 @@ void FloatingDragPreviewPrivate::updateDropOverlays(const QPoint &GlobalPos)
123123
int VisibleDockAreas = TopContainer->visibleDockAreaCount();
124124
ContainerOverlay->setAllowedAreas(
125125
VisibleDockAreas > 1 ? OuterDockAreas : AllDockAreas);
126-
DockWidgetArea ContainerArea = ContainerOverlay->showOverlay(TopContainer);
126+
127+
DockWidgetArea ContainerArea = InvalidDockWidgetArea;
128+
// If there is only one single visible dock area in a container, then
129+
// it does not make sense to show a dock overlay because the dock area
130+
// would be removed and inserted at the same position
131+
if (VisibleDockAreas <= 1)
132+
{
133+
ContainerOverlay->hideOverlay();
134+
}
135+
else
136+
{
137+
ContainerArea = ContainerOverlay->showOverlay(TopContainer);
138+
}
127139
ContainerOverlay->enableDropPreview(ContainerArea != InvalidDockWidgetArea);
128140
auto DockArea = TopContainer->dockAreaAt(GlobalPos);
129141
if (DockArea && DockArea->isVisible() && VisibleDockAreas > 0 && DockArea != ContentSourceArea)
@@ -151,14 +163,6 @@ void FloatingDragPreviewPrivate::updateDropOverlays(const QPoint &GlobalPos)
151163
else
152164
{
153165
DockAreaOverlay->hideOverlay();
154-
// If there is only one single visible dock area in a container, then
155-
// it does not make sense to show a dock overlay because the dock area
156-
// would be removed and inserted at the same position
157-
if (VisibleDockAreas <= 1)
158-
{
159-
ContainerOverlay->hideOverlay();
160-
}
161-
162166
if (DockArea == ContentSourceArea && InvalidDockWidgetArea == ContainerDropArea)
163167
{
164168
DropContainer = nullptr;

0 commit comments

Comments
 (0)