Merge lp:~unity-team/unity8/rtm-14.09-staging into lp:unity8/rtm-14.09

Proposed by Michael Zanetti
Status: Merged
Merged at revision: 1407
Proposed branch: lp:~unity-team/unity8/rtm-14.09-staging
Merge into: lp:unity8/rtm-14.09
Diff against target: 77 lines (+23/-4)
3 files modified
qml/Stages/SpreadDelegate.qml (+8/-1)
tests/mocks/Unity/Application/ApplicationManager.cpp (+7/-0)
tests/qmltests/Stages/tst_SpreadDelegate.qml (+8/-3)
To merge this branch: bzr merge lp:~unity-team/unity8/rtm-14.09-staging
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+244918@code.launchpad.net

Commit message

Backport fixes to RTM

- Bug #1368287
- Bug #1394208

To post a comment you must log in.
1419. By Andrea Cimitan on 2014-12-16

Different drag behaviour for not closable apps in spread

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Stages/SpreadDelegate.qml'
2--- qml/Stages/SpreadDelegate.qml 2014-09-19 11:20:07 +0000
3+++ qml/Stages/SpreadDelegate.qml 2014-12-16 22:08:28 +0000
4@@ -41,10 +41,17 @@
5 Item {
6 objectName: "appWindowWithShadow"
7
8- y: dragArea.distance
9+ readonly property real limit: root.height / 4
10+
11+ y: root.closeable ? dragArea.distance : elastic(dragArea.distance)
12 width: parent.width
13 height: parent.height
14
15+ function elastic(distance) {
16+ var k = distance < 0 ? -limit : limit
17+ return k * (1 - Math.pow((k - 1) / k, distance))
18+ }
19+
20 BorderImage {
21 anchors {
22 fill: appWindow
23
24=== modified file 'tests/mocks/Unity/Application/ApplicationManager.cpp'
25--- tests/mocks/Unity/Application/ApplicationManager.cpp 2014-09-29 09:54:30 +0000
26+++ tests/mocks/Unity/Application/ApplicationManager.cpp 2014-12-16 22:08:28 +0000
27@@ -20,6 +20,7 @@
28 #include "ApplicationTestInterface.h"
29
30 #include <paths.h>
31+#include <csignal>
32
33 #include <QDir>
34 #include <QGuiApplication>
35@@ -36,6 +37,12 @@
36 {
37 if (!the_application_manager) {
38 the_application_manager = new ApplicationManager();
39+
40+ // Emit signal to notify Upstart that Mir is ready to receive client connections
41+ // see http://upstart.ubuntu.com/cookbook/#expect-stop
42+ if (qgetenv("UNITY_MIR_EMITS_SIGSTOP") == "1") {
43+ raise(SIGSTOP);
44+ }
45 }
46 return the_application_manager;
47 }
48
49=== modified file 'tests/qmltests/Stages/tst_SpreadDelegate.qml'
50--- tests/qmltests/Stages/tst_SpreadDelegate.qml 2014-08-13 19:50:09 +0000
51+++ tests/qmltests/Stages/tst_SpreadDelegate.qml 2014-12-16 22:08:28 +0000
52@@ -110,7 +110,7 @@
53 {tag: "swipeToClose=true closeable=true -> appWindow moves away",
54 swipeToClose: true, closeable: true },
55
56- {tag: "swipeToClose=true closeable=alse -> appWindow bounces back",
57+ {tag: "swipeToClose=true closeable=false -> appWindow bounces back",
58 swipeToClose: true, closeable: false },
59
60 {tag: "swipeToClose=false -> appWindow stays put",
61@@ -134,10 +134,15 @@
62 touchX /* fromX */, fromY, touchX /* toX */, toY,
63 true /* beginTouch */, false /* endTouch */, dragArea.minSpeedToClose * 1.1 /* speed */);
64
65-
66 if (data.swipeToClose) {
67 verify(appWindowWithShadow.y < 0);
68- verify(Math.abs(Math.abs(appWindowWithShadow.y) - dragDistance) < units.gu(1));
69+ if (data.closeable) {
70+ // Verify that the delegate started moving exactly "threshold" after the finger movement
71+ // and did not jump up to the finger, but lags the threshold behind
72+ verify(Math.abs(Math.abs(appWindowWithShadow.y) - dragDistance) < units.gu(1));
73+ } else {
74+ verify(Math.abs(Math.abs(appWindowWithShadow.y) - dragDistance) > units.gu(1));
75+ }
76
77 touchRelease(spreadDelegateLoader.item, touchX, toY - units.gu(1));
78

Subscribers

People subscribed via source and target branches

to all changes: