indicators: Depend less on FloatingWindow

Deal in terms of WindowBeingDragged instead, as wayland won't have
a floating window being dragged
This commit is contained in:
Sergio Martins
2020-10-14 19:24:35 +01:00
parent 1219ba90af
commit c2cc914b5c
8 changed files with 40 additions and 18 deletions

View File

@@ -13,7 +13,6 @@
#include "Frame_p.h"
#include "DropArea_p.h"
#include "FloatingWindow_p.h"
using namespace KDDockWidgets;
@@ -25,20 +24,20 @@ DropIndicatorOverlayInterface::DropIndicatorOverlayInterface(DropArea *dropArea)
setObjectName(QStringLiteral("DropIndicatorOverlayInterface"));
}
void DropIndicatorOverlayInterface::setWindowBeingDragged(const FloatingWindow *window)
void DropIndicatorOverlayInterface::setWindowBeingDragged(bool is)
{
if (window == m_windowBeingDragged)
if (is == m_draggedWindowIsHovering)
return;
m_windowBeingDragged = window;
if (m_windowBeingDragged) {
m_draggedWindowIsHovering = is;
if (is) {
setGeometry(m_dropArea->QWidgetAdapter::rect());
raise();
} else {
setHoveredFrame(nullptr);
}
setVisible(m_windowBeingDragged != nullptr);
setVisible(is);
updateVisibility();
}
@@ -70,7 +69,7 @@ void DropIndicatorOverlayInterface::setHoveredFrame(Frame *frame)
bool DropIndicatorOverlayInterface::isHovered() const
{
return m_windowBeingDragged != nullptr;
return m_draggedWindowIsHovering;
}
DropIndicatorOverlayInterface::DropLocation DropIndicatorOverlayInterface::currentDropLocation() const