Merge lp:~mzanetti/unity8/windowed-by-kbd-only into lp:unity8

Proposed by Michael Zanetti on 2016-01-26
Status: Merged
Approved by: Michał Sawicz on 2016-01-29
Approved revision: 2139
Merged at revision: 2156
Proposed branch: lp:~mzanetti/unity8/windowed-by-kbd-only
Merge into: lp:unity8
Prerequisite: lp:~dandrader/unity8/dontRotateDesktop-lp1515977
Diff against target: 111 lines (+54/-29)
2 files modified
qml/OrientedShell.qml (+11/-4)
tests/qmltests/tst_OrientedShell.qml (+43/-25)
To merge this branch: bzr merge lp:~mzanetti/unity8/windowed-by-kbd-only
Reviewer Review Type Date Requested Status
Michał Sawicz code 2016-01-26 Approve on 2016-01-29
Unity8 CI Bot continuous-integration 2016-01-26 Needs Fixing on 2016-01-28
PS Jenkins bot continuous-integration 2016-01-26 Needs Fixing on 2016-01-28
Review via email: mp+284011@code.launchpad.net

This proposal supersedes a proposal from 2016-01-20.

Commit Message

Make big tablets switch to windowed mode by plugging a kbd only

Description of the Change

 * Are there any related MPs required for this MP to build/function as expected? Please list.

nope

 * 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?

nope

 * If you changed the UI, has there been a design review?

nope

To post a comment you must log in.
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2137
http://jenkins.qa.ubuntu.com/job/unity8-ci/7118/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6105
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/533/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1823
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/526
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1718
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1718
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/525
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/524
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4713
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6116
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6116/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26856
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/270/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/531
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/531/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26855

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/7118/rebuild

review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2137
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/160/
Executed test runs:

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

review: Needs Fixing (continuous-integration)
Michał Sawicz (saviq) : Posted in a previous version of this proposal
review: Needs Information
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2138
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/206/
Executed test runs:

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

review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2138
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/207/
Executed test runs:

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

review: Needs Fixing (continuous-integration)
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2138
http://jenkins.qa.ubuntu.com/job/unity8-ci/7158/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6209
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/573/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1863
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/566
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1758
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1758
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/565
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/564
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4787
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6220
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6220/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27058
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/296/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/571
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/571/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27057

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/7158/rebuild

review: Needs Fixing (continuous-integration)
2139. By Michael Zanetti on 2016-01-27

drop debug prints

PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2139
http://jenkins.qa.ubuntu.com/job/unity8-ci/7165/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6233
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/580/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1870
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/573
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1765
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1765
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/572
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/571
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4802
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6244
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6244/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27105
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/299/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/578
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/578/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27104

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/7165/rebuild

review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2139
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/215/
Executed test runs:

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

review: Needs Fixing (continuous-integration)
Michał Sawicz (saviq) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Cimi's testing the silo

 * Did CI run pass? If not, please explain why.
Only failures fixed in other branches

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

review: Approve (code)
Michał Sawicz (saviq) wrote :

Approving per cimi's silo testing.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/OrientedShell.qml'
2--- qml/OrientedShell.qml 2015-12-01 13:56:54 +0000
3+++ qml/OrientedShell.qml 2016-01-27 23:42:38 +0000
4@@ -202,11 +202,18 @@
5 return "tablet";
6 }
7 } else { // automatic
8- if (miceModel.count + touchPadModel.count > 0) {
9- return "desktop";
10- } else {
11- return deviceConfiguration.category;
12+ var longEdgeWidth = Math.max(root.width, root.height)
13+ if (longEdgeWidth > units.gu(120)) {
14+ if (keyboardsModel.count + miceModel.count + touchPadModel.count > 0) {
15+ return "desktop";
16+ }
17+ } else if (longEdgeWidth > units.gu(90)){
18+ if (miceModel.count + touchPadModel.count > 0) {
19+ return "desktop";
20+ }
21 }
22+
23+ return deviceConfiguration.category;
24 }
25 }
26
27
28=== modified file 'tests/qmltests/tst_OrientedShell.qml'
29--- tests/qmltests/tst_OrientedShell.qml 2016-01-27 23:42:38 +0000
30+++ tests/qmltests/tst_OrientedShell.qml 2016-01-27 23:42:38 +0000
31@@ -1001,37 +1001,55 @@
32 tryCompare(shell, "transformRotationAngle", 0);
33 }
34
35- function test_attachRemoveInputDevices() {
36+ function test_attachRemoveInputDevices_data() {
37+ return [
38+ { tag: "small screen, no devices", screenWidth: units.gu(50), mouse: false, kbd: false, expectedMode: "phone", oskExpected: true },
39+ { tag: "medium screen, no devices", screenWidth: units.gu(100), mouse: false, kbd: false, expectedMode: "phone", oskExpected: true },
40+ { tag: "big screen, no devices", screenWidth: units.gu(200), mouse: false, kbd: false, expectedMode: "phone", oskExpected: true },
41+ { tag: "small screen, mouse", screenWidth: units.gu(50), mouse: true, kbd: false, expectedMode: "phone", oskExpected: true },
42+ { tag: "medium screen, mouse", screenWidth: units.gu(100), mouse: true, kbd: false, expectedMode: "desktop", oskExpected: true },
43+ { tag: "big screen, mouse", screenWidth: units.gu(200), mouse: true, kbd: false, expectedMode: "desktop", oskExpected: true },
44+ { tag: "small screen, kbd", screenWidth: units.gu(50), mouse: false, kbd: true, expectedMode: "phone", oskExpected: false },
45+ { tag: "medium screen, kbd", screenWidth: units.gu(100), mouse: false, kbd: true, expectedMode: "phone", oskExpected: false },
46+ { tag: "big screen, kbd", screenWidth: units.gu(200), mouse: false, kbd: true, expectedMode: "desktop", oskExpected: false },
47+ { tag: "small screen, mouse & kbd", screenWidth: units.gu(50), mouse: true, kbd: true, expectedMode: "phone", oskExpected: false },
48+ { tag: "medium screen, mouse & kbd", screenWidth: units.gu(100), mouse: true, kbd: true, expectedMode: "desktop", oskExpected: false },
49+ { tag: "big screen, mouse & kbd", screenWidth: units.gu(200), mouse: true, kbd: true, expectedMode: "desktop", oskExpected: false },
50+ ]
51+ }
52+
53+ function test_attachRemoveInputDevices(data) {
54 usageModeSelector.selectAutomatic();
55 tryCompare(mockUnity8Settings, "usageMode", "Automatic")
56
57 loadShell("mako")
58 var shell = findChild(orientedShell, "shell");
59
60- tryCompare(shell, "usageScenario", "phone");
61- tryCompare(mockOskSettings, "stayHidden", false);
62-
63- MockInputDeviceBackend.addMockDevice("/kbd0", InputInfo.Keyboard);
64- tryCompare(shell, "usageScenario", "phone");
65- tryCompare(mockOskSettings, "stayHidden", true);
66-
67- MockInputDeviceBackend.addMockDevice("/mouse0", InputInfo.Mouse);
68- tryCompare(shell, "usageScenario", "desktop");
69- tryCompare(mockOskSettings, "stayHidden", true);
70-
71- MockInputDeviceBackend.removeDevice("/kbd0");
72- tryCompare(shell, "usageScenario", "desktop");
73- tryCompare(mockOskSettings, "stayHidden", false);
74-
75- MockInputDeviceBackend.removeDevice("/mouse0");
76- tryCompare(shell, "usageScenario", "phone");
77- tryCompare(mockOskSettings, "stayHidden", false);
78-
79- MockInputDeviceBackend.addMockDevice("/touchpad0", InputInfo.TouchPad);
80- tryCompare(shell, "usageScenario", "desktop");
81-
82- MockInputDeviceBackend.removeDevice("/touchpad0");
83- tryCompare(shell, "usageScenario", "phone");
84+ var oldWidth = orientedShellLoader.width;
85+ orientedShellLoader.width = data.screenWidth;
86+
87+ tryCompare(shell, "usageScenario", "phone");
88+ tryCompare(mockOskSettings, "stayHidden", false);
89+
90+ if (data.kbd) {
91+ MockInputDeviceBackend.addMockDevice("/kbd0", InputInfo.Keyboard);
92+ }
93+ if (data.mouse) {
94+ MockInputDeviceBackend.addMockDevice("/mouse0", InputInfo.Mouse);
95+ }
96+
97+ tryCompare(shell, "usageScenario", data.expectedMode);
98+ tryCompare(mockOskSettings, "stayHidden", !data.oskExpected);
99+
100+ if (data.kbd) {
101+ MockInputDeviceBackend.removeDevice("/kbd0");
102+ }
103+ if (data.mouse) {
104+ MockInputDeviceBackend.removeDevice("/mouse0");
105+ }
106+
107+ // Restore width
108+ orientedShellLoader.width = oldWidth;
109 }
110
111 /*

Subscribers

People subscribed via source and target branches