on xenial help sign in
cancel the drag as soon as we're entering the spread
commit2db34082a516e3ad2bbad8ea464f8179bb9f2b7f authorLukáš Tinkl <lukas.tinkl@canonical.com> dateWed 1 Mar 2017, 12:08 (10 years ago) parent71b62b7
3 files changed+15
qml/Stage/DecoratedWindow.qml+4 qml/Stage/MoveHandler.qml+9 qml/Stage/Stage.qml+2
qml/Stage/DecoratedWindow.qml+4
@@ -80,6 +80,10 @@ FocusScope {
8080 signal decorationPressed()
8181 signal decorationReleased()
8282
83+ function cancelDrag() {
84+ moveHandler.cancelDrag();
85+ }
86+
8387 QtObject {
8488 id: d
8589 property int requestedDecorationHeight: root.hasDecoration ? decoration.height : 0
qml/Stage/MoveHandler.qml+9
@@ -190,4 +190,13 @@ QtObject {
190190 target.restoredY = target.y;
191191 }
192192 }
193+
194+ function cancelDrag() {
195+ priv.dragging = false;
196+ root.stopFakeAnimation();
197+ priv.mouseDownTimer.stop();
198+ Mir.cursorName = "";
199+ priv.progress = 0;
200+ priv.resetEdges();
201+ }
193202}
qml/Stage/Stage.qml+2
@@ -1173,6 +1173,7 @@ FocusScope {
11731173 states: [
11741174 State {
11751175 name: "spread"; when: root.state == "spread"
1176+ StateChangeScript { script: { decoratedWindow.cancelDrag(); } }
11761177 PropertyChanges {
11771178 target: decoratedWindow;
11781179 showDecoration: false;
@@ -1199,6 +1200,7 @@ FocusScope {
11991200 }
12001201 PropertyChanges { target: dragArea; enabled: true }
12011202 PropertyChanges { target: windowInfoItem; opacity: spreadMaths.tileInfoOpacity; visible: spreadMaths.itemVisible }
1203+ PropertyChanges { target: touchControls; enabled: false }
12021204 },
12031205 State {
12041206 name: "stagedRightEdge"