on xenial help sign in
Merge lp:~lukas-kde/unity8/fix-restore-positio
b60611eAlbert Astals Cid
qml/Stage/ChildWindowTree.qml−4
@@ -60,10 +60,6 @@ Item {
60 property real windowedX: x
60 property real windowedX: x
61 property real windowedY: y
61 property real windowedY: y
62
62
63−
64− property real restoredX
65− property real restoredY
66−
67 state: "restored"
63 state: "restored"
68 // end of API expected by MoveHandler
64 // end of API expected by MoveHandler
69 ////
65 ////
qml/Stage/MoveHandler.qml−5
@@ -188,11 +188,6 @@ QtObject {
188 priv.progress = 0;
188 priv.progress = 0;
189 priv.resetEdges();
189 priv.resetEdges();
190 }
190 }
191− if ((target.state == "normal" || target.state == "restored") && priv.progress == 0) {
192− // save the x/y to restore to
193− target.restoredX = target.x;
194− target.restoredY = target.y;
195− }
196 }
191 }
197
192
198 function cancelDrag() {
193 function cancelDrag() {
qml/Stage/Stage.qml+10−2
@@ -753,6 +753,14 @@ FocusScope {
753 normalHeight = appDelegate.height;
753 normalHeight = appDelegate.height;
754 }
754 }
755 }
755 }
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+
756 Connections {
764 Connections {
757 target: appDelegate
765 target: appDelegate
758 onXChanged: appDelegate.updateNormalGeometry();
766 onXChanged: appDelegate.updateNormalGeometry();
@@ -1626,7 +1634,7 @@ FocusScope {
1626 }
1634 }
1627 onMinimizeClicked: { appDelegate.requestMinimize(); }
1635 onMinimizeClicked: { appDelegate.requestMinimize(); }
1628 onDecorationPressed: { appDelegate.activate(); }
1636 onDecorationPressed: { appDelegate.activate(); }
1629− onDecorationReleased: fakeRectangle.commit();
1637+ onDecorationReleased: fakeRectangle.visible ? fakeRectangle.commit() : appDelegate.updateRestoredGeometry()
1630
1638
1631 property real angle: 0
1639 property real angle: 0
1632 Behavior on angle { enabled: priv.closingIndex >= 0; UbuntuNumberAnimation {} }
1640 Behavior on angle { enabled: priv.closingIndex >= 0; UbuntuNumberAnimation {} }
@@ -1670,7 +1678,7 @@ FocusScope {
1670 onFakeMaximizeBottomLeftAnimationRequested: if (!appDelegate.maximizedBottomLeft) fakeRectangle.maximizeBottomLeft(amount, true);
1678 onFakeMaximizeBottomLeftAnimationRequested: if (!appDelegate.maximizedBottomLeft) fakeRectangle.maximizeBottomLeft(amount, true);
1671 onFakeMaximizeBottomRightAnimationRequested: if (!appDelegate.maximizedBottomRight) fakeRectangle.maximizeBottomRight(amount, true);
1679 onFakeMaximizeBottomRightAnimationRequested: if (!appDelegate.maximizedBottomRight) fakeRectangle.maximizeBottomRight(amount, true);
1672 onStopFakeAnimation: fakeRectangle.stop();
1680 onStopFakeAnimation: fakeRectangle.stop();
1673− onDragReleased: fakeRectangle.commit();
1681+ onDragReleased: fakeRectangle.visible ? fakeRectangle.commit() : appDelegate.updateRestoredGeometry()
1674 }
1682 }
1675
1683
1676 WindowedFullscreenPolicy {
1684 WindowedFullscreenPolicy {