@@ -753,6 +753,14 @@ FocusScope {
753753 normalHeight = appDelegate.height;
754754 }
755755 }
756+ function updateRestoredGeometry() {
757+ if (appDelegate.state == "normal" || appDelegate.state == "restored") {
758+ // save the x/y to restore to
759+ restoredX = appDelegate.x;
760+ restoredY = appDelegate.y;
761+ }
762+ }
763+
756764 Connections {
757765 target: appDelegate
758766 onXChanged: appDelegate.updateNormalGeometry();
@@ -1626,7 +1634,7 @@ FocusScope {
16261634 }
16271635 onMinimizeClicked: { appDelegate.requestMinimize(); }
16281636 onDecorationPressed: { appDelegate.activate(); }
1629− onDecorationReleased: fakeRectangle.commit();
1637+ onDecorationReleased: fakeRectangle.visible ? fakeRectangle.commit() : appDelegate.updateRestoredGeometry()
16301638
16311639 property real angle: 0
16321640 Behavior on angle { enabled: priv.closingIndex >= 0; UbuntuNumberAnimation {} }
@@ -1670,7 +1678,7 @@ FocusScope {
16701678 onFakeMaximizeBottomLeftAnimationRequested: if (!appDelegate.maximizedBottomLeft) fakeRectangle.maximizeBottomLeft(amount, true);
16711679 onFakeMaximizeBottomRightAnimationRequested: if (!appDelegate.maximizedBottomRight) fakeRectangle.maximizeBottomRight(amount, true);
16721680 onStopFakeAnimation: fakeRectangle.stop();
1673− onDragReleased: fakeRectangle.commit();
1681+ onDragReleased: fakeRectangle.visible ? fakeRectangle.commit() : appDelegate.updateRestoredGeometry()
16741682 }
16751683
16761684 WindowedFullscreenPolicy {