Fix floating window position when dragging with constraints

When the detach starts we might make the window smaller so it
respects the max-size constraint. The quirk was that in that
case the window was no longer under the mouse cursor, so looked
weird while dragging, although it worked
This commit is contained in:
Sergio Martins
2020-06-08 18:19:46 +01:00
parent 4cf1159019
commit 8baac15d24
4 changed files with 18 additions and 4 deletions

View File

@@ -273,7 +273,7 @@ void DockWidgetBase::setFloating(bool floats)
auto lastGeo = lastPositions().lastFloatingGeometry();
if (lastGeo.isValid()) {
if (auto fw = floatingWindow())
fw->setSuggestedGeometry(lastGeo);
fw->setSuggestedGeometry(lastGeo, /*preserveCenter=*/true);
}
} else {
saveLastFloatingGeometry();