Merge lp:~nick-dedekind/unity8/sidestage-rotation into lp:unity8

Proposed by Nick Dedekind
Status: Rejected
Rejected by: Michael Zanetti
Proposed branch: lp:~nick-dedekind/unity8/sidestage-rotation
Merge into: lp:unity8
Prerequisite: lp:~nick-dedekind/unity8/sidestage-restoreOnRotation
Diff against target: 127 lines (+65/-12)
2 files modified
qml/Stages/TabletStage.qml (+22/-12)
tests/qmltests/tst_OrientedShell.qml (+43/-0)
To merge this branch: bzr merge lp:~nick-dedekind/unity8/sidestage-rotation
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Disapprove
Albert Astals Cid (community) Needs Fixing
Unity8 CI Bot continuous-integration Needs Fixing
Daniel d'Andrada Pending
Review via email: mp+297912@code.launchpad.net

Commit message

Fixed sidestage rotation issue.

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

 * 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.
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2493
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1565/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2078
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1083
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1083
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1083/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2106
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2017
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2017
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2017
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2008
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2008/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2008
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2008/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2008
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2008/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2008
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2008/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2008
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2008/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2008
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2008/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2008
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2008/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2008
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2008/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2008
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2008/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1565/rebuild

review: Needs Fixing (continuous-integration)
Daniel d'Andrada (dandrader) wrote :

"Tests that if the device is rotated to portrait when a sidetage is open when a mainstage app that does not support portrait orientation"

Hard to follow. Could use some rephrasing.

Daniel d'Andrada (dandrader) wrote :

Could you please add that to tst_OrientedShell so that this use case can be tried out manually?
Currently there's no way for us to launch primary-oriented-app in "make tryOrientedShell"

"""
                Repeater {
                    model: ApplicationManager.availableApplications
                    ApplicationCheckBox {
                        appId: modelData
                    }
                }
"""

Albert Astals Cid (aacid) wrote :

Contents conflict in qml/Stage/TabletStage.qml
1 conflicts encountered.

review: Needs Fixing
Michael Zanetti (mzanetti) wrote :

I think we can drop this...TabletStage is no more. I used snippets of this MP in unified-stages so this should be good there already.

review: Disapprove

Unmerged revisions

2493. By Nick Dedekind on 2016-06-20

fixed sidestage rotation

2492. By Nick Dedekind on 2016-06-20

merged parent

2491. By Nick Dedekind on 2016-06-20

merged dash sidestage

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Stages/TabletStage.qml'
2--- qml/Stages/TabletStage.qml 2016-06-20 14:06:12 +0000
3+++ qml/Stages/TabletStage.qml 2016-06-20 14:06:12 +0000
4@@ -656,11 +656,17 @@
5 Behavior on opacity { UbuntuNumberAnimation {} }
6
7 onShownChanged: {
8- if (!shown && priv.sideStageDelegate && priv.focusedAppDelegate === priv.sideStageDelegate
9- && priv.mainStageDelegate) {
10- priv.mainStageDelegate.focus = true;
11- } else if (shown && priv.sideStageDelegate) {
12- priv.sideStageDelegate.focus = true;
13+
14+ if (!shown && priv.sideStageDelegate && priv.focusedAppDelegate === priv.sideStageDelegate) {
15+ priv.updateMainAndSideStageIndexes();
16+ if (priv.mainStageDelegate) {
17+ priv.mainStageDelegate.focus = true;
18+ }
19+ } else if (shown) {
20+ priv.updateMainAndSideStageIndexes();
21+ if (priv.sideStageDelegate) {
22+ priv.sideStageDelegate.focus = true;
23+ }
24 }
25 }
26
27@@ -835,11 +841,6 @@
28 }
29
30 property bool _constructing: true;
31- onStageChanged: {
32- if (!_constructing) {
33- priv.updateMainAndSideStageIndexes();
34- }
35- }
36
37 Component.onCompleted: {
38 // a top level window is always the focused one when it first appears, unfocusing
39@@ -948,6 +949,7 @@
40 // Sidestage was focused, so show the side stage.
41 sideStage.show();
42 }
43+ priv.updateMainAndSideStageIndexes();
44 }
45 }
46 }
47@@ -959,8 +961,11 @@
48 script: {
49 if (priv.sideStageDelegate === spreadTile &&
50 mainApp && (mainApp.supportedOrientations & (Qt.PortraitOrientation|Qt.InvertedPortraitOrientation)) == 0) {
51- // The mainstage app did not natively support portrait orientation, so focus the sidestage.
52+ // The mainstage app did not natively support portrait orientation, so focus the sidestage app.
53 spreadTile.focus = true;
54+ // Hide the sidestage.
55+ // Since if we flip back the landscape only app, it will open the sidestage and go back to portrait.
56+ sideStage.hide();
57 }
58 }
59 }
60@@ -968,7 +973,12 @@
61 target: spreadTile
62 properties: "width,height,supportedOrientations,shellOrientationAngle,shellOrientation,orientations"
63 }
64- ScriptAction { script: { spreadTile.matchShellOrientation(); } }
65+ ScriptAction {
66+ script: {
67+ spreadTile.matchShellOrientation();
68+ priv.updateMainAndSideStageIndexes();
69+ }
70+ }
71 }
72 }
73 ]
74
75=== modified file 'tests/qmltests/tst_OrientedShell.qml'
76--- tests/qmltests/tst_OrientedShell.qml 2016-06-20 14:06:12 +0000
77+++ tests/qmltests/tst_OrientedShell.qml 2016-06-20 14:06:12 +0000
78@@ -1388,6 +1388,49 @@
79 compare(shell.orientation, orientedShell.orientations.landscape);
80 }
81
82+ /*
83+ Tests that if the device is rotated to portrait when a sidetage is open when a mainstage app
84+ that does not support portrait orientation, the sidestage will be on top with focus and correct
85+ portrait orientation.
86+ */
87+ function test_sideStageOnTopIfRotatedWithUnsupportedOrientationMainstageApp_data() {
88+ return [
89+ {tag: "manta-mainAppFocused", deviceName: "manta", mainFocued: true},
90+ {tag: "manta-sideStageFocused", deviceName: "manta", mainFocued: false},
91+ {tag: "flo-mainAppFocused", deviceName: "flo", mainFocued: true},
92+ {tag: "flo-sideStageFocused", deviceName: "flo", mainFocued: false}
93+ ];
94+ }
95+ function test_sideStageOnTopIfRotatedWithUnsupportedOrientationMainstageApp(data) {
96+ loadShell(data.deviceName);
97+ WindowStateStorage.saveStage("dialer-app", ApplicationInfoInterface.SideStage)
98+
99+ var primarySurfaceId = topLevelSurfaceList.nextId;
100+ var primaryApp = ApplicationManager.startApplication("primary-oriented-app");
101+ verify(primaryApp);
102+ waitUntilAppWindowIsFullyLoaded(primarySurfaceId);
103+
104+ var dialerSurfaceId = topLevelSurfaceList.nextId;
105+ var dialerApp = ApplicationManager.startApplication("dialer-app");
106+ verify(dialerApp);
107+ waitUntilAppWindowIsFullyLoaded(dialerSurfaceId);
108+
109+ var dialerAppWindow = findAppWindowForSurfaceId(dialerSurfaceId);
110+ verify(dialerAppWindow)
111+
112+ if (data.mainFocused) {
113+ ApplicationManager.requestFocusApplication("primary-oriented-app");
114+ verify(isAppSurfaceFocused(primaryAppWindow));
115+ }
116+
117+ // when rotating to portrait, the dialer should be in portrait and on top.
118+ rotateTo(90);
119+ tryCompareFunction(function(){return checkAppSurfaceOrientation(dialerAppWindow, dialerApp, root.primaryOrientationAngle + 90)}, true);
120+ compare(shell.transformRotationAngle, root.primaryOrientationAngle + 90);
121+ verify(isAppSurfaceFocused(dialerSurfaceId));
122+ }
123+
124+
125 // angle - rotation angle in degrees clockwise, relative to the primary orientation.
126 function rotateTo(angle) {
127 switch (angle) {

Subscribers

People subscribed via source and target branches