@@ -752,6 +752,14 @@ FocusScope {
752752 normalHeight = appDelegate.height;
753753 }
754754 }
755+ function updateRestoredGeometry() {
756+ if (appDelegate.state == "normal" || appDelegate.state == "restored") {
757+ // save the x/y to restore to
758+ restoredX = appDelegate.x;
759+ restoredY = appDelegate.y;
760+ }
761+ }
762+
755763 Connections {
756764 target: appDelegate
757765 onXChanged: appDelegate.updateNormalGeometry();
@@ -1612,7 +1620,7 @@ FocusScope {
16121620 }
16131621 onMinimizeClicked: { appDelegate.requestMinimize(); }
16141622 onDecorationPressed: { appDelegate.activate(); }
1615− onDecorationReleased: fakeRectangle.commit();
1623+ onDecorationReleased: fakeRectangle.visible ? fakeRectangle.commit() : appDelegate.updateRestoredGeometry()
16161624
16171625 property real angle: 0
16181626 Behavior on angle { enabled: priv.closingIndex >= 0; UbuntuNumberAnimation {} }
@@ -1656,7 +1664,7 @@ FocusScope {
16561664 onFakeMaximizeBottomLeftAnimationRequested: if (!appDelegate.maximizedBottomLeft) fakeRectangle.maximizeBottomLeft(amount, true);
16571665 onFakeMaximizeBottomRightAnimationRequested: if (!appDelegate.maximizedBottomRight) fakeRectangle.maximizeBottomRight(amount, true);
16581666 onStopFakeAnimation: fakeRectangle.stop();
1659− onDragReleased: fakeRectangle.commit();
1667+ onDragReleased: fakeRectangle.visible ? fakeRectangle.commit() : appDelegate.updateRestoredGeometry()
16601668 }
16611669
16621670 WindowedFullscreenPolicy {