Merge lp:~feng-kylin/unity8/forbidClosingAppsDuringGesture into lp:unity8

Proposed by handsome_feng on 2015-05-13
Status: Merged
Approved by: Michael Zanetti on 2015-05-29
Approved revision: 1781
Merged at revision: 1824
Proposed branch: lp:~feng-kylin/unity8/forbidClosingAppsDuringGesture
Merge into: lp:unity8
Diff against target: 64 lines (+32/-0)
3 files modified
qml/Stages/PhoneStage.qml (+7/-0)
qml/Stages/TabletStage.qml (+6/-0)
tests/qmltests/Stages/tst_PhoneStage.qml (+19/-0)
To merge this branch: bzr merge lp:~feng-kylin/unity8/forbidClosingAppsDuringGesture
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing on 2015-05-29
Michael Zanetti (community) 2015-05-13 Approve on 2015-05-29
Albert Astals Cid (community) Needs Information on 2015-05-21
Review via email: mp+258975@code.launchpad.net

Commit message

Forbid closing apps during the edge gesture.

Description of the change

Forbid closing apps during the edge gesture.

 * 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
 * Did you make sure that your branch does not contain spurious tags?

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.
Michael Zanetti (mzanetti) wrote :

Looks good. Please add a test for it.

review: Needs Fixing
1778. By handsome_feng on 2015-05-15

add a test for it

handsome_feng (feng-kylin) wrote :

> Looks good. Please add a test for it.

done

Michael Zanetti (mzanetti) wrote :

Thanks!

I noticed that the email address you've set up on Launchpad to sign the CLA is a different one that you've used to commit this patch.

Can you please either add this qq.com mail address to your Launchpad account or change the commits to use <email address hidden>

review: Needs Information
handsome_feng (feng-kylin) wrote :

> Thanks!
>
> I noticed that the email address you've set up on Launchpad to sign the CLA is
> a different one that you've used to commit this patch.
>
> Can you please either add this qq.com mail address to your Launchpad account
> or change the commits to use <email address hidden>

Done, I add the qq.com mail address to my Launchpad account.

Albert Astals Cid (aacid) wrote :

Triggered CI

Albert Astals Cid (aacid) wrote :

This looks nice, do you think you could try making it so that when you vertically swipe starting the horizontal swipe the animation does not break?

review: Needs Information
1779. By handsome_feng on 2015-05-26

Use a MouseArea to eat touch events while edge gesture, because the second touch point will cause the valuse of contendX of the spreadView unpredictable

1780. By handsome_feng on 2015-05-26

Use a MouseArea to eat touch events while edge gesture, because the second touch point will cause the value of contentX of the spreadView unpredictable

Daniel d'Andrada (dandrader) wrote :

"""
8+ //eat touch events during the right edge gesture
9+ MouseArea {
10+ objectName: "MouseArea"
11+ anchors.fill: parent
"""

Could use a more descriptive object name like "eventEaterArea"

1781. By handsome_feng on 2015-05-27

use a more descriptive object name

handsome_feng (feng-kylin) wrote :

> """
> 8+ //eat touch events during the right edge gesture
> 9+ MouseArea {
> 10+ objectName: "MouseArea"
> 11+ anchors.fill: parent
> """
>
> Could use a more descriptive object name like "eventEaterArea"

Yeah, done. thanks!

Michael Zanetti (mzanetti) wrote :

Thanks a lot for this! Looks and works great.

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

yes

 * Did CI run pass? If not, please explain why.

Need to be manually triggered on 3rd Party contribution. I've triggered it but I also verified manually that the tests are working.

 * Did you make sure that the branch does not contain spurious tags?

yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qml/Stages/PhoneStage.qml'
--- qml/Stages/PhoneStage.qml 2015-05-18 23:03:25 +0000
+++ qml/Stages/PhoneStage.qml 2015-05-27 01:21:49 +0000
@@ -449,6 +449,13 @@
449 }449 }
450 }450 }
451451
452 //eat touch events during the right edge gesture
453 MouseArea {
454 objectName: "eventEaterArea"
455 anchors.fill: parent
456 enabled: spreadDragArea.dragging
457 }
458
452 DirectionalDragArea {459 DirectionalDragArea {
453 id: spreadDragArea460 id: spreadDragArea
454 objectName: "spreadDragArea"461 objectName: "spreadDragArea"
455462
=== modified file 'qml/Stages/TabletStage.qml'
--- qml/Stages/TabletStage.qml 2015-05-18 23:03:25 +0000
+++ qml/Stages/TabletStage.qml 2015-05-27 01:21:49 +0000
@@ -596,6 +596,12 @@
596 }596 }
597 }597 }
598598
599 //eat touch events during the right edge gesture
600 MouseArea {
601 anchors.fill: parent
602 enabled: spreadDragArea.dragging
603 }
604
599 DirectionalDragArea {605 DirectionalDragArea {
600 id: spreadDragArea606 id: spreadDragArea
601 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }607 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
602608
=== modified file 'tests/qmltests/Stages/tst_PhoneStage.qml'
--- tests/qmltests/Stages/tst_PhoneStage.qml 2015-04-10 21:16:37 +0000
+++ tests/qmltests/Stages/tst_PhoneStage.qml 2015-05-27 01:21:49 +0000
@@ -399,6 +399,25 @@
399 tryCompare(spreadView, "contentX", -spreadView.shift)399 tryCompare(spreadView, "contentX", -spreadView.shift)
400 }400 }
401401
402 function test_cantAccessPhoneStageWhileRightEdgeGesture() {
403 var spreadView = findChild(phoneStage, "spreadView");
404 var eventEaterArea = findChild(phoneStage, "eventEaterArea")
405
406 var startX = phoneStage.width - 2;
407 var startY = phoneStage.height / 2;
408 var endY = startY;
409 var endX = phoneStage.width / 2;
410
411 touchFlick(phoneStage, startX, startY, endX, endY,
412 true /* beginTouch */, false /* endTouch */, units.gu(10), 50);
413
414 compare(eventEaterArea.enabled, true);
415
416 touchRelease(phoneStage, endX, endY);
417
418 compare(eventEaterArea.enabled, false);
419 }
420
402 function test_leftEdge_data() {421 function test_leftEdge_data() {
403 return [422 return [
404 { tag: "normal", inSpread: false, leftEdgeDragWidth: units.gu(5), shouldMoveApp: true },423 { tag: "normal", inSpread: false, leftEdgeDragWidth: units.gu(5), shouldMoveApp: true },

Subscribers

People subscribed via source and target branches