Merge lp:~mzanetti/unity8/dont-tease-while-moving into lp:unity8

Proposed by Michael Zanetti
Status: Merged
Approved by: Andrea Cimitan
Approved revision: 480
Merged at revision: 494
Proposed branch: lp:~mzanetti/unity8/dont-tease-while-moving
Merge into: lp:unity8
Diff against target: 66 lines (+20/-7)
2 files modified
Greeter/Greeter.qml (+1/-1)
tests/qmltests/Greeter/tst_Phone.qml (+19/-6)
To merge this branch: bzr merge lp:~mzanetti/unity8/dont-tease-while-moving
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Andrea Cimitan (community) Approve
Review via email: mp+192366@code.launchpad.net

Commit message

don't trigger the greeter teasing during a movement of the greeter

Description of the change

This fixes an issue with the Greeter getting stuck in the middle of a transition.

To reproduce: swipe the greeter a bit to the left and release it so that it moves back to locking the device. While it's moving back, quickly tap on it. The teasing animation will kick in and leave the greeter at the position where it was when the click happened.

We don't really need the teasing animation in any other case than the user no knowing how to unlock. So this commit changes the teaser to only kick in when idling at x == 0.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:479
http://jenkins.qa.ubuntu.com/job/unity8-ci/1483/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/33
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/33/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/7
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/7
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/7
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/7/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/7
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/27
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/33
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/33/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/33
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/33/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2662/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2713/console
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/363
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/362

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/unity8-ci/1483/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

== 0 or >= 0?

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

hmm. I don't think we can move the greeter to the right. but even if we could I guess the teaser should be disabled there too. We really only want the teasing to work when the greeter is at 0,0

480. By Michael Zanetti

improve comments

Revision history for this message
Andrea Cimitan (cimi) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Greeter/Greeter.qml'
--- Greeter/Greeter.qml 2013-09-13 15:17:02 +0000
+++ Greeter/Greeter.qml 2013-10-29 14:20:30 +0000
@@ -52,7 +52,7 @@
52 signal unlocked(int uid)52 signal unlocked(int uid)
5353
54 onRightTeaserPressedChanged: {54 onRightTeaserPressedChanged: {
55 if (rightTeaserPressed && !locked) {55 if (rightTeaserPressed && !locked && x == 0) {
56 teasingTimer.start();56 teasingTimer.start();
57 }57 }
58 }58 }
5959
=== modified file 'tests/qmltests/Greeter/tst_Phone.qml'
--- tests/qmltests/Greeter/tst_Phone.qml 2013-09-30 16:03:59 +0000
+++ tests/qmltests/Greeter/tst_Phone.qml 2013-10-29 14:20:30 +0000
@@ -83,8 +83,9 @@
8383
84 function test_teaseLockedUnlocked_data() {84 function test_teaseLockedUnlocked_data() {
85 return [85 return [
86 {tag: "unlocked", locked: false},86 {tag: "unlocked", locked: false, moved: false},
87 {tag: "locked", locked: true}87 {tag: "locked", locked: true, moved: false},
88 {tag: "moved", locked: false, moved: true}
88 ];89 ];
89 }90 }
9091
@@ -93,10 +94,16 @@
93 tryCompare(greeter, "x", 0);94 tryCompare(greeter, "x", 0);
94 greeter.locked = data.locked;95 greeter.locked = data.locked;
9596
97 // simulate greeter being in the middle of a swipe
98 if (data.moved) {
99 greeter.x = -units.gu(4);
100 tryCompare(greeter, "x", -units.gu(4));
101 }
102
96 mouseClick(greeter, greeter.width - units.gu(5), greeter.height - units.gu(1));103 mouseClick(greeter, greeter.width - units.gu(5), greeter.height - units.gu(1));
97 greeter.minX = 0; // This is needed because the transition actually makes x jump once before animating104 greeter.minX = 0; // This is needed because the transition actually makes x jump once before animating
98105
99 if (!data.locked) {106 if (!data.locked && !data.moved) {
100 // Check if it has been moved over by 2 GUs. Give it a 2 pixel grace area107 // Check if it has been moved over by 2 GUs. Give it a 2 pixel grace area
101 // because animation duration and teaseTimer are the same duration and108 // because animation duration and teaseTimer are the same duration and
102 // might cause slight offsets109 // might cause slight offsets
@@ -104,10 +111,16 @@
104 } else {111 } else {
105 // waiting 100ms to make sure nothing moves112 // waiting 100ms to make sure nothing moves
106 wait(100);113 wait(100);
107 compare(greeter.minX, 0, "Greeter moved even tho its locked");114 compare(greeter.minX, 0, "Greeter teasing not disabled even though it's locked or moving.");
108 }115 }
116
117 // Restore position in case we moved it for the test
118 if (data.moved) {
119 greeter.x = 0;
120 }
121
109 // Wait until we're back to 0122 // Wait until we're back to 0
110 tryCompareFunction(function() { return greeter.x;}, 0);123 tryCompareFunction(function() { return greeter.x;}, 0);
111 }124 }
112125
113 function test_statsWelcomeScreen() {126 function test_statsWelcomeScreen() {

Subscribers

People subscribed via source and target branches