Save floating geometry right before starting a drag

so if you drop, then set floating again it goes to the original
floating position
This commit is contained in:
Sergio Martins
2020-05-22 12:15:24 +01:00
parent bd848d8040
commit 7a852f700f

View File

@@ -175,6 +175,12 @@ StateDragging::~StateDragging() = default;
void StateDragging::onEntry(QEvent *)
{
if (DockWidgetBase *dw = q->m_draggable->singleDockWidget()) {
// When we start to drag a floating window which has a single dock widget, we save the position
if (dw->isFloating())
dw->saveLastFloatingGeometry();
}
q->m_windowBeingDragged = q->m_draggable->makeWindow();
if (q->m_windowBeingDragged) {
qCDebug(state) << "StateDragging entered. m_draggable=" << q->m_draggable << "; m_windowBeingDragged=" << q->m_windowBeingDragged->floatingWindow();