Fix setDropIndicatorsInhibited(false) not showing drop indicators

It required the user to move the mouse, which was OK but we can do
better.

Now, KDDW will automaticallt re-show the drop indicators if we're in
the middle of a drag operation.

Required for issue #334 and issue #337
This commit is contained in:
Sergio Martins
2023-02-07 21:58:37 +00:00
parent 31b0ad8d7d
commit 57aded2a67
2 changed files with 10 additions and 4 deletions

View File

@@ -31,10 +31,14 @@ DropIndicatorOverlayInterface::DropIndicatorOverlayInterface(DropArea *dropArea)
connect(DockRegistry::self(), &DockRegistry::dropIndicatorsInhibitedChanged, this,
[this](bool inhibited) {
if (inhibited)
if (inhibited) {
removeHover();
// if false then simply moving the mouse will make the drop indicators appear again
} else {
// Re-add hover. Fastest way is simply faking a mouse move
if (auto state = qobject_cast<StateDragging *>(DragController::instance()->activeState())) {
state->handleMouseMove(QCursor::pos());
}
}
});
}