Merge lp:~lukas-kde/unity8/cancel-drag-in-spread into lp:unity8

Proposed by Lukáš Tinkl
Status: Merged
Approved by: Michael Zanetti
Approved revision: 2841
Merged at revision: 2857
Proposed branch: lp:~lukas-kde/unity8/cancel-drag-in-spread
Merge into: lp:unity8
Diff against target: 89 lines (+41/-0)
4 files modified
qml/Stage/DecoratedWindow.qml (+4/-0)
qml/Stage/MoveHandler.qml (+9/-0)
qml/Stage/Stage.qml (+2/-0)
tests/qmltests/Stage/tst_DesktopStage.qml (+26/-0)
To merge this branch: bzr merge lp:~lukas-kde/unity8/cancel-drag-in-spread
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
Unity8 CI Bot continuous-integration Approve
Review via email: mp+318587@code.launchpad.net

Commit message

Cancel the drag as soon as we're entering the spread

Description of the change

Cancel the drag as soon as we're entering the spread

Fixes lp:1668642 - [unity8] can still drag windows while the app switcher is active

* Are there any related MPs required for this MP to build/function as expected? Please list.

No

* Did you perform an exploratory manual test run of your code change and any related functionality?

Yes

* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

N/A

* If you changed the UI, has there been a design review?

N/A

To post a comment you must log in.
Revision history for this message
Michael Zanetti (mzanetti) wrote :

works fine, looks good. mind adding a test?

review: Needs Information
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2838
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3236/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4245
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2517
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2517
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4273
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4108
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4108/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4108
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4108/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4108
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4108/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4108
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4108/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4108
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4108/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4108
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4108/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3236/rebuild

review: Approve (continuous-integration)
2839. By Lukáš Tinkl

add a test

Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

> works fine, looks good. mind adding a test?

Yup, test added

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2839
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3238/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4247
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2523
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2523
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4275
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4110
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4110/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4110
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4110/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4110
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4110/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4110
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4110/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4110
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4110/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4110
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4110/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3238/rebuild

review: Needs Fixing (continuous-integration)
2840. By Lukáš Tinkl

stabilize test

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2840
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3246/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4263
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2532
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2532
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4291
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4125
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4125/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4125
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4125/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4125
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4125/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4125
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4125/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4125
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4125/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4125
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4125/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3246/rebuild

review: Needs Fixing (continuous-integration)
2841. By Lukáš Tinkl

take a different more reliable approach at detecting whether the window is moving

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2841
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3251/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4272
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2542
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2542
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4300
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4134
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4134/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4134
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4134/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4134
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4134/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4134
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4134/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4134
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4134/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4134
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4134/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3251/rebuild

review: Approve (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Tests in CI passing now

Revision history for this message
Michael Zanetti (mzanetti) wrote :

yip yip!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Stage/DecoratedWindow.qml'
2--- qml/Stage/DecoratedWindow.qml 2017-01-26 11:10:01 +0000
3+++ qml/Stage/DecoratedWindow.qml 2017-03-01 17:02:40 +0000
4@@ -80,6 +80,10 @@
5 signal decorationPressed()
6 signal decorationReleased()
7
8+ function cancelDrag() {
9+ moveHandler.cancelDrag();
10+ }
11+
12 QtObject {
13 id: d
14 property int requestedDecorationHeight: root.hasDecoration ? decoration.height : 0
15
16=== modified file 'qml/Stage/MoveHandler.qml'
17--- qml/Stage/MoveHandler.qml 2017-01-26 11:10:01 +0000
18+++ qml/Stage/MoveHandler.qml 2017-03-01 17:02:40 +0000
19@@ -190,4 +190,13 @@
20 target.restoredY = target.y;
21 }
22 }
23+
24+ function cancelDrag() {
25+ priv.dragging = false;
26+ root.stopFakeAnimation();
27+ priv.mouseDownTimer.stop();
28+ Mir.cursorName = "";
29+ priv.progress = 0;
30+ priv.resetEdges();
31+ }
32 }
33
34=== modified file 'qml/Stage/Stage.qml'
35--- qml/Stage/Stage.qml 2017-02-16 13:44:45 +0000
36+++ qml/Stage/Stage.qml 2017-03-01 17:02:40 +0000
37@@ -1173,6 +1173,7 @@
38 states: [
39 State {
40 name: "spread"; when: root.state == "spread"
41+ StateChangeScript { script: { decoratedWindow.cancelDrag(); } }
42 PropertyChanges {
43 target: decoratedWindow;
44 showDecoration: false;
45@@ -1199,6 +1200,7 @@
46 }
47 PropertyChanges { target: dragArea; enabled: true }
48 PropertyChanges { target: windowInfoItem; opacity: spreadMaths.tileInfoOpacity; visible: spreadMaths.itemVisible }
49+ PropertyChanges { target: touchControls; enabled: false }
50 },
51 State {
52 name: "stagedRightEdge"
53
54=== modified file 'tests/qmltests/Stage/tst_DesktopStage.qml'
55--- tests/qmltests/Stage/tst_DesktopStage.qml 2017-02-16 13:43:56 +0000
56+++ tests/qmltests/Stage/tst_DesktopStage.qml 2017-03-01 17:02:40 +0000
57@@ -771,6 +771,32 @@
58 tryCompareFunction(function(){return posBefore == posAfter;}, data.button !== Qt.LeftButton ? true : false);
59 }
60
61+ function test_spreadDisablesWindowDrag() {
62+ var appDelegate = startApplication("dialer-app");
63+ verify(appDelegate);
64+ var decoration = findChild(appDelegate, "appWindowDecoration");
65+ verify(decoration);
66+
67+ // grab the decoration
68+ mousePress(decoration);
69+
70+ // enter the spread
71+ keyPress(Qt.Key_W, Qt.MetaModifier)
72+ tryCompare(stage, "state", "spread");
73+
74+ // try to drag the window
75+ mouseMove(decoration, 10, 10, 200);
76+
77+ // verify it's not moving even before we release the decoration drag
78+ tryCompare(appDelegate, "dragging", false);
79+
80+ // cleanup
81+ mouseRelease(decoration);
82+ keyRelease(Qt.Key_W, Qt.MetaModifier);
83+ stage.closeSpread();
84+ tryCompare(stage, "state", "windowed");
85+ }
86+
87 // regression test for https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1627281
88 function test_doubleTapToMaximizeWindow() {
89 var dialerAppDelegate = startApplication("dialer-app");

Subscribers

People subscribed via source and target branches