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
1=== modified file 'Greeter/Greeter.qml'
2--- Greeter/Greeter.qml 2013-09-13 15:17:02 +0000
3+++ Greeter/Greeter.qml 2013-10-29 14:20:30 +0000
4@@ -52,7 +52,7 @@
5 signal unlocked(int uid)
6
7 onRightTeaserPressedChanged: {
8- if (rightTeaserPressed && !locked) {
9+ if (rightTeaserPressed && !locked && x == 0) {
10 teasingTimer.start();
11 }
12 }
13
14=== modified file 'tests/qmltests/Greeter/tst_Phone.qml'
15--- tests/qmltests/Greeter/tst_Phone.qml 2013-09-30 16:03:59 +0000
16+++ tests/qmltests/Greeter/tst_Phone.qml 2013-10-29 14:20:30 +0000
17@@ -83,8 +83,9 @@
18
19 function test_teaseLockedUnlocked_data() {
20 return [
21- {tag: "unlocked", locked: false},
22- {tag: "locked", locked: true}
23+ {tag: "unlocked", locked: false, moved: false},
24+ {tag: "locked", locked: true, moved: false},
25+ {tag: "moved", locked: false, moved: true}
26 ];
27 }
28
29@@ -93,10 +94,16 @@
30 tryCompare(greeter, "x", 0);
31 greeter.locked = data.locked;
32
33+ // simulate greeter being in the middle of a swipe
34+ if (data.moved) {
35+ greeter.x = -units.gu(4);
36+ tryCompare(greeter, "x", -units.gu(4));
37+ }
38+
39 mouseClick(greeter, greeter.width - units.gu(5), greeter.height - units.gu(1));
40 greeter.minX = 0; // This is needed because the transition actually makes x jump once before animating
41
42- if (!data.locked) {
43+ if (!data.locked && !data.moved) {
44 // Check if it has been moved over by 2 GUs. Give it a 2 pixel grace area
45 // because animation duration and teaseTimer are the same duration and
46 // might cause slight offsets
47@@ -104,10 +111,16 @@
48 } else {
49 // waiting 100ms to make sure nothing moves
50 wait(100);
51- compare(greeter.minX, 0, "Greeter moved even tho its locked");
52- }
53+ compare(greeter.minX, 0, "Greeter teasing not disabled even though it's locked or moving.");
54+ }
55+
56+ // Restore position in case we moved it for the test
57+ if (data.moved) {
58+ greeter.x = 0;
59+ }
60+
61 // Wait until we're back to 0
62- tryCompareFunction(function() { return greeter.x;}, 0);
63+ tryCompareFunction(function() { return greeter.x;}, 0);
64 }
65
66 function test_statsWelcomeScreen() {

Subscribers

People subscribed via source and target branches