Don't show middle dock indicator if frame isn't dockable

This was implemented but the logic was wrong.
Fixes central persistent showing the central indicator.
This commit is contained in:
Sergio Martins
2022-04-19 15:51:44 +01:00
parent b1379f0bef
commit 6166e5805c

View File

@@ -144,7 +144,7 @@ bool DropIndicatorOverlayInterface::dropIndicatorVisible(DropLocation dropLoc) c
if (isTheOnlyFrame && !DockRegistry::self()->isProbablyObscured(m_hoveredFrame->window()->windowHandle(), windowBeingDragged))
return false;
} else if (dropLoc == DropLocation_Center) {
if (!m_hoveredFrame)
if (!m_hoveredFrame || !m_hoveredFrame->isDockable())
return false;
if (auto tabbingAllowedFunc = Config::self().tabbingAllowedFunc()) {
@@ -153,7 +153,7 @@ bool DropIndicatorOverlayInterface::dropIndicatorVisible(DropLocation dropLoc) c
}
// Only allow to dock to center if the affinities match
if (!DockRegistry::self()->affinitiesMatch(m_hoveredFrame->affinities(), windowBeingDragged->affinities()) && m_hoveredFrame->isDockable())
if (!DockRegistry::self()->affinitiesMatch(m_hoveredFrame->affinities(), windowBeingDragged->affinities()))
return false;
} else {
qWarning() << Q_FUNC_INFO << "Unknown drop indicator location" << dropLoc;