Merge lp:~mzanetti/unity8/disable-swipetoclose-while-schnapping into lp:unity8

Proposed by Michael Zanetti
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 1435
Merged at revision: 1454
Proposed branch: lp:~mzanetti/unity8/disable-swipetoclose-while-schnapping
Merge into: lp:unity8
Diff against target: 92 lines (+35/-5)
3 files modified
qml/Stages/PhoneStage.qml (+1/-1)
qml/Stages/TabletStage.qml (+1/-1)
tests/qmltests/Stages/tst_PhoneStage.qml (+33/-3)
To merge this branch: bzr merge lp:~mzanetti/unity8/disable-swipetoclose-while-schnapping
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+241691@code.launchpad.net

Commit message

disable swipeToClose while some snapping is happening

Description of the change

 * 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.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

The code makes sense but i can't seem to find a way to reproduce making it go bad. Any tip on what to do?

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

> The code makes sense but i can't seem to find a way to reproduce making it go
> bad. Any tip on what to do?

for the record:

[17:19] <mzanetti> tsdgeos: basically you go to spread, then tap on an app
[17:20] <mzanetti> tsdgeos: and while its animating to front, quickly press and hold again
[17:20] <mzanetti> tsdgeos: then you should be able to drag it up/down, even though it's in foreground

Revision history for this message
Albert Astals Cid (aacid) wrote :

 * 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.
autopilot is borked

 * 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
1=== modified file 'qml/Stages/PhoneStage.qml'
2--- qml/Stages/PhoneStage.qml 2014-11-13 12:22:03 +0000
3+++ qml/Stages/PhoneStage.qml 2014-11-18 09:50:22 +0000
4@@ -286,7 +286,7 @@
5 otherSelected: spreadView.selectedIndex >= 0 && !selected
6 interactive: !spreadView.interactive && spreadView.phase === 0
7 && spreadView.shiftedContentX === 0 && root.interactive && index === 0
8- swipeToCloseEnabled: spreadView.interactive
9+ swipeToCloseEnabled: spreadView.interactive && !snapAnimation.running
10 maximizedAppTopMargin: root.maximizedAppTopMargin
11 dropShadow: spreadView.active ||
12 (priv.focusedAppDelegate && priv.focusedAppDelegate.x !== 0)
13
14=== modified file 'qml/Stages/TabletStage.qml'
15--- qml/Stages/TabletStage.qml 2014-11-13 12:22:03 +0000
16+++ qml/Stages/TabletStage.qml 2014-11-18 09:50:22 +0000
17@@ -490,7 +490,7 @@
18 otherSelected: spreadView.selectedIndex >= 0 && !selected
19 isInSideStage: priv.sideStageAppId == model.appId
20 interactive: !spreadView.interactive && spreadView.phase === 0 && root.interactive
21- swipeToCloseEnabled: spreadView.interactive
22+ swipeToCloseEnabled: spreadView.interactive && !snapAnimation.running
23 maximizedAppTopMargin: root.maximizedAppTopMargin
24 dragOffset: !isDash && model.appId == priv.mainStageAppId && root.inverseProgress > 0 ? root.inverseProgress : 0
25 application: ApplicationManager.get(index)
26
27=== modified file 'tests/qmltests/Stages/tst_PhoneStage.qml'
28--- tests/qmltests/Stages/tst_PhoneStage.qml 2014-11-04 12:52:02 +0000
29+++ tests/qmltests/Stages/tst_PhoneStage.qml 2014-11-18 09:50:22 +0000
30@@ -274,7 +274,7 @@
31 compare(ApplicationManager.focusedApplicationId, selectedApp.appId);
32 }
33
34- function test_orientation_change_sent_to_focused_app() {
35+ function test_orientationChangeSentToFocusedApp() {
36 phoneStage.orientation = Qt.PortraitOrientation;
37 addApps(1);
38
39@@ -286,7 +286,7 @@
40 tryCompare(app, "orientation", Qt.LandscapeOrientation);
41 }
42
43- function test_orientation_change_not_sent_to_apps_while_spread_open() {
44+ function test_orientationChangeNotSentToAppsWhileSpreadOpen() {
45 phoneStage.orientation = Qt.PortraitOrientation;
46 addApps(1);
47
48@@ -299,7 +299,7 @@
49 tryCompare(app, "orientation", Qt.PortraitOrientation);
50 }
51
52- function test_orientation_change_not_sent_to_unfocused_app_until_it_focused() {
53+ function test_orientationChangeNotSentToUnfocusedAppUntilItFocused() {
54 phoneStage.orientation = Qt.PortraitOrientation;
55 addApps(1);
56
57@@ -357,5 +357,35 @@
58 tryCompare(firstApp, "state", ApplicationInfoInterface.Running);
59 tryCompare(firstApp, "focused", true);
60 }
61+
62+ function test_cantCloseWhileSnapping() {
63+ addApps(2);
64+
65+ goToSpread();
66+
67+ var spreadView = findChild(phoneStage, "spreadView");
68+ var selectedApp = ApplicationManager.get(2);
69+
70+ goToSpread();
71+
72+ var app0 = findChild(spreadView, "appDelegate0");
73+ var app1 = findChild(spreadView, "appDelegate1");
74+ var app2 = findChild(spreadView, "appDelegate2");
75+
76+ var dragArea0 = findChild(app0, "dragArea");
77+ var dragArea1 = findChild(app1, "dragArea");
78+ var dragArea2 = findChild(app2, "dragArea");
79+
80+ compare(dragArea0.enabled, true);
81+ compare(dragArea1.enabled, true);
82+ compare(dragArea2.enabled, true);
83+
84+ phoneStage.select(selectedApp.appId);
85+
86+ // Make sure all drag areas are disabled instantly. Don't use tryCompare here!
87+ compare(dragArea0.enabled, false);
88+ compare(dragArea1.enabled, false);
89+ compare(dragArea2.enabled, false);
90+ }
91 }
92 }

Subscribers

People subscribed via source and target branches