Merge lp:~unity-team/unity8/stagedFullscreen.form-factor into lp:unity8
- stagedFullscreen.form-factor
- Merge into trunk
Status: | Work in progress |
---|---|
Proposed branch: | lp:~unity-team/unity8/stagedFullscreen.form-factor |
Merge into: | lp:unity8 |
Diff against target: |
348 lines (+158/-10) 9 files modified
qml/Stages/AbstractStage.qml (+15/-0) qml/Stages/DesktopStage.qml (+41/-9) qml/Stages/PhoneStage.qml (+2/-0) qml/Stages/TabletStage.qml (+2/-0) tests/mocks/Unity/Screens/ScreenWindow.qml (+24/-0) tests/mocks/Unity/Screens/Screens.qmltypes (+57/-0) tests/mocks/Unity/Screens/plugin.cpp (+2/-1) tests/mocks/Unity/Screens/qmldir (+3/-0) tests/mocks/Unity/Screens/screens.h (+12/-0) |
To merge this branch: | bzr merge lp:~unity-team/unity8/stagedFullscreen.form-factor |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Unity8 CI Bot | continuous-integration | Needs Fixing | |
Albert Astals Cid (community) | Needs Fixing | ||
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Michał Sawicz | code | Approve | |
Michael Zanetti (community) | Needs Information | ||
Review via email: mp+285053@code.launchpad.net |
Commit message
Set form factor on all screens
Description of the change
* Are there any related MPs required for this MP to build/function as expected? Please list.
lp:~nick-dedekind/qtmir/stagedFullscreen.form-factor
* Did you perform an exploratory manual test run of your code change and any related functionality?
Will do in silo
* Did you make sure that your branch does not contain spurious tags?
Y
* 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?
Will be in silo
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2174
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michael Zanetti (mzanetti) wrote : | # |
I don't think having the repeater in the AbstractStage is the right thing to do. For example, in the case of an external display, we'd have 2 screens, however, the Stage would run only on one of them. Still it sets both screens to FormFactorMonitor.
I guess the current circumstances still make it work for all the cases we support atm, but it really doesn't look like this is gonna be future proof like this.
Do I understand something wrong?
Nick Dedekind (nick-dedekind) wrote : | # |
> I don't think having the repeater in the AbstractStage is the right thing to
> do. For example, in the case of an external display, we'd have 2 screens,
> however, the Stage would run only on one of them. Still it sets both screens
> to FormFactorMonitor.
>
> I guess the current circumstances still make it work for all the cases we
> support atm, but it really doesn't look like this is gonna be future proof
> like this.
>
> Do I understand something wrong?
This is a temporary solution. we have an idea for the final thing; but it's a wip at the moment.
Michael Zanetti (mzanetti) wrote : | # |
So, given this is quite temporary, and we don't have a chance to come up with the proper things at this point, I'd suggest to move the repeater into Shell.qml and determine the form factor from Shell.useScenario. That way we only have to add temporary code (and please add a FIXME comment) to 1 place instead of distributing it over 4 files.
If the screens api allows us to do so, try setting the form factor only to the screen in use, instead of all screens. If not, don't bother, this will do for now.
- 2175. By Nick Dedekind
-
added FIXME
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2175
https:/
Executed test runs:
Click here to trigger a rebuild:
https:/
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2175
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Nick Dedekind (nick-dedekind) wrote : | # |
> So, given this is quite temporary, and we don't have a chance to come up with
> the proper things at this point, I'd suggest to move the repeater into
> Shell.qml and determine the form factor from Shell.useScenario. That way we
> only have to add temporary code (and please add a FIXME comment) to 1 place
> instead of distributing it over 4 files.
>
> If the screens api allows us to do so, try setting the form factor only to the
> screen in use, instead of all screens. If not, don't bother, this will do for
> now.
I've added a fixme. I still believe it's up to the stage to decide which form factor it uses.
Michał Sawicz (saviq) wrote : | # |
* Did you perform an exploratory manual test run of the code change and any related functionality?
Y
* Did CI run pass? If not, please explain why.
One test fixed elsewhere
* Did you make sure that the branch does not contain spurious tags?
Y
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2175
https:/
Executed test runs:
Click here to trigger a rebuild:
https:/
- 2176. By Nick Dedekind
-
Fixed requestedHeight
/Width
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2176
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2176
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
Text conflict in qml/Stages/
1 conflicts encountered.
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2176
https:/
Executed test runs:
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Michał Sawicz (saviq) wrote : | # |
Text conflict in qml/Stages/
Text conflict in qml/Stages/
2 conflicts encountered.
Unmerged revisions
- 2176. By Nick Dedekind
-
Fixed requestedHeight
/Width - 2175. By Nick Dedekind
-
added FIXME
- 2174. By Nick Dedekind
-
Set screen form factor
- 2173. By Nick Dedekind
-
Add FormFactor to Unity.Screens mock
Preview Diff
1 | === modified file 'qml/Stages/AbstractStage.qml' |
2 | --- qml/Stages/AbstractStage.qml 2016-01-14 13:03:20 +0000 |
3 | +++ qml/Stages/AbstractStage.qml 2016-02-10 11:16:44 +0000 |
4 | @@ -17,6 +17,7 @@ |
5 | import QtQuick 2.4 |
6 | import Ubuntu.Components 1.3 |
7 | import GSettings 1.0 |
8 | +import Unity.Screens 0.1 |
9 | |
10 | Rectangle { |
11 | id: root |
12 | @@ -48,6 +49,7 @@ |
13 | | Qt.LandscapeOrientation |
14 | | Qt.InvertedPortraitOrientation |
15 | | Qt.InvertedLandscapeOrientation |
16 | + property var formFactor |
17 | |
18 | // Shared code for use in stage implementations |
19 | GSettings { |
20 | @@ -64,4 +66,17 @@ |
21 | } |
22 | return false; |
23 | } |
24 | + |
25 | + // FIXME - Form factor should be a per screen decision and handled by the window. |
26 | + Repeater { |
27 | + model: Screens {} |
28 | + Item { |
29 | + Binding { |
30 | + target: model |
31 | + when: model.formFactor != Screens.FormFactorUnknown && root.formFactor !== undefined |
32 | + property: "formFactor" |
33 | + value: root.formFactor |
34 | + } |
35 | + } |
36 | + } |
37 | } |
38 | |
39 | === modified file 'qml/Stages/DesktopStage.qml' |
40 | --- qml/Stages/DesktopStage.qml 2016-01-14 13:03:20 +0000 |
41 | +++ qml/Stages/DesktopStage.qml 2016-02-10 11:16:44 +0000 |
42 | @@ -17,6 +17,7 @@ |
43 | import QtQuick 2.4 |
44 | import Ubuntu.Components 1.3 |
45 | import Unity.Application 0.1 |
46 | +import Unity.Screens 0.1 |
47 | import "../Components/PanelState" |
48 | import "../Components" |
49 | import Utils 0.1 |
50 | @@ -39,6 +40,7 @@ |
51 | mainApp: ApplicationManager.focusedApplicationId |
52 | ? ApplicationManager.findApplication(ApplicationManager.focusedApplicationId) |
53 | : null |
54 | + formFactor: Screens.FormFactorMonitor |
55 | |
56 | // application windows never rotate independently |
57 | mainAppWindowOrientationAngle: shellOrientationAngle |
58 | @@ -254,8 +256,8 @@ |
59 | focus: appId === priv.focusedAppId |
60 | width: decoratedWindow.width |
61 | height: decoratedWindow.height |
62 | - property alias requestedWidth: decoratedWindow.requestedWidth |
63 | - property alias requestedHeight: decoratedWindow.requestedHeight |
64 | + property int requestedWidth: -1 |
65 | + property int requestedHeight: -1 |
66 | |
67 | QtObject { |
68 | id: appDelegatePrivate |
69 | @@ -366,20 +368,40 @@ |
70 | PropertyChanges { |
71 | target: appDelegate; |
72 | x: 0; y: 0; |
73 | - requestedWidth: root.width; requestedHeight: root.height; |
74 | visuallyMinimized: false; |
75 | visuallyMaximized: true |
76 | } |
77 | + PropertyChanges { |
78 | + target: decoratedWindow |
79 | + requestedWidth: root.width; |
80 | + requestedHeight: root.height; |
81 | + } |
82 | }, |
83 | State { |
84 | name: "maximizedLeft"; when: appDelegate.maximizedLeft && !appDelegate.minimized |
85 | - PropertyChanges { target: appDelegate; x: 0; y: PanelState.panelHeight; |
86 | - requestedWidth: root.width/2; requestedHeight: root.height - PanelState.panelHeight } |
87 | + PropertyChanges { |
88 | + target: appDelegate; |
89 | + x: 0; |
90 | + y: PanelState.panelHeight; |
91 | + } |
92 | + PropertyChanges { |
93 | + target: decoratedWindow |
94 | + requestedWidth: root.width/2 |
95 | + requestedHeight: root.height - PanelState.panelHeight |
96 | + } |
97 | }, |
98 | State { |
99 | name: "maximizedRight"; when: appDelegate.maximizedRight && !appDelegate.minimized |
100 | - PropertyChanges { target: appDelegate; x: root.width/2; y: PanelState.panelHeight; |
101 | - requestedWidth: root.width/2; requestedHeight: root.height - PanelState.panelHeight } |
102 | + PropertyChanges { |
103 | + target: appDelegate; |
104 | + x: root.width/2; |
105 | + y: PanelState.panelHeight |
106 | + } |
107 | + PropertyChanges { |
108 | + target: decoratedWindow |
109 | + requestedWidth: root.width/2; |
110 | + requestedHeight: root.height - PanelState.panelHeight |
111 | + } |
112 | }, |
113 | State { |
114 | name: "minimized"; when: appDelegate.minimized |
115 | @@ -399,13 +421,17 @@ |
116 | enabled: appDelegate.animationsEnabled |
117 | PropertyAction { target: appDelegate; properties: "visuallyMinimized,visuallyMaximized" } |
118 | UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: UbuntuAnimation.FastDuration } |
119 | + UbuntuNumberAnimation { target: decoratedWindow; properties: "requestedWidth,requestedHeight"; duration: UbuntuAnimation.FastDuration } |
120 | }, |
121 | Transition { |
122 | to: "minimized" |
123 | enabled: appDelegate.animationsEnabled |
124 | PropertyAction { target: appDelegate; property: "visuallyMaximized" } |
125 | SequentialAnimation { |
126 | - UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: UbuntuAnimation.FastDuration } |
127 | + ParallelAnimation { |
128 | + UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,scale"; duration: UbuntuAnimation.FastDuration } |
129 | + UbuntuNumberAnimation { target: decoratedWindow; properties: "requestedWidth,requestedHeight"; duration: UbuntuAnimation.FastDuration } |
130 | + } |
131 | PropertyAction { target: appDelegate; property: "visuallyMinimized" } |
132 | ScriptAction { |
133 | script: { |
134 | @@ -421,7 +447,10 @@ |
135 | enabled: appDelegate.animationsEnabled |
136 | PropertyAction { target: appDelegate; property: "visuallyMinimized" } |
137 | SequentialAnimation { |
138 | - UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: UbuntuAnimation.FastDuration } |
139 | + ParallelAnimation { |
140 | + UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,scale"; duration: UbuntuAnimation.FastDuration } |
141 | + UbuntuNumberAnimation { target: decoratedWindow; properties: "requestedWidth,requestedHeight"; duration: UbuntuAnimation.FastDuration } |
142 | + } |
143 | PropertyAction { target: appDelegate; property: "visuallyMaximized" } |
144 | } |
145 | } |
146 | @@ -457,6 +486,9 @@ |
147 | active: ApplicationManager.focusedApplicationId === model.appId |
148 | focus: true |
149 | |
150 | + requestedWidth: appDelegate.requestedWidth |
151 | + requestedHeight: appDelegate.requestedHeight |
152 | + |
153 | onClose: ApplicationManager.stopApplication(model.appId) |
154 | onMaximize: appDelegate.maximized || appDelegate.maximizedLeft || appDelegate.maximizedRight |
155 | ? appDelegate.restoreFromMaximized() : appDelegate.maximize() |
156 | |
157 | === modified file 'qml/Stages/PhoneStage.qml' |
158 | --- qml/Stages/PhoneStage.qml 2016-01-14 13:03:20 +0000 |
159 | +++ qml/Stages/PhoneStage.qml 2016-02-10 11:16:44 +0000 |
160 | @@ -18,6 +18,7 @@ |
161 | import Ubuntu.Components 1.3 |
162 | import Ubuntu.Gestures 0.1 |
163 | import Unity.Application 0.1 |
164 | +import Unity.Screens 0.1 |
165 | import Unity.Session 0.1 |
166 | import Utils 0.1 |
167 | import Powerd 0.1 |
168 | @@ -77,6 +78,7 @@ |
169 | mainApp: applicationManager.focusedApplicationId |
170 | ? applicationManager.findApplication(applicationManager.focusedApplicationId) |
171 | : null |
172 | + formFactor: Screens.FormFactorPhone |
173 | |
174 | orientationChangesEnabled: priv.focusedAppOrientationChangesEnabled |
175 | && !priv.focusedAppDelegateIsDislocated |
176 | |
177 | === modified file 'qml/Stages/TabletStage.qml' |
178 | --- qml/Stages/TabletStage.qml 2016-01-14 13:03:20 +0000 |
179 | +++ qml/Stages/TabletStage.qml 2016-02-10 11:16:44 +0000 |
180 | @@ -18,6 +18,7 @@ |
181 | import Ubuntu.Components 1.3 |
182 | import Ubuntu.Gestures 0.1 |
183 | import Unity.Application 0.1 |
184 | +import Unity.Screens 0.1 |
185 | import Utils 0.1 |
186 | import Powerd 0.1 |
187 | import "../Components" |
188 | @@ -70,6 +71,7 @@ |
189 | } |
190 | } |
191 | |
192 | + formFactor: Screens.FormFactorTablet |
193 | orientationChangesEnabled: priv.mainAppOrientationChangesEnabled |
194 | |
195 | supportedOrientations: mainApp ? mainApp.supportedOrientations |
196 | |
197 | === added file 'tests/mocks/Unity/Screens/ScreenWindow.qml' |
198 | --- tests/mocks/Unity/Screens/ScreenWindow.qml 1970-01-01 00:00:00 +0000 |
199 | +++ tests/mocks/Unity/Screens/ScreenWindow.qml 2016-02-10 11:16:44 +0000 |
200 | @@ -0,0 +1,24 @@ |
201 | +/* |
202 | + * Copyright (C) 2016 Canonical, Ltd. |
203 | + * |
204 | + * This program is free software; you can redistribute it and/or modify |
205 | + * it under the terms of the GNU General Public License as published by |
206 | + * the Free Software Foundation; version 3. |
207 | + * |
208 | + * This program is distributed in the hope that it will be useful, |
209 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
210 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
211 | + * GNU General Public License for more details. |
212 | + * |
213 | + * You should have received a copy of the GNU General Public License |
214 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
215 | + */ |
216 | + |
217 | +import QtQuick 2.4 |
218 | +import Unity.Screens 0.1 |
219 | + |
220 | +Rectangle { |
221 | + property var screens: 1 |
222 | + property real scale: 1.0 |
223 | + property int formFactor: Screens.FormFactorMonitor |
224 | +} |
225 | |
226 | === added file 'tests/mocks/Unity/Screens/Screens.qmltypes' |
227 | --- tests/mocks/Unity/Screens/Screens.qmltypes 1970-01-01 00:00:00 +0000 |
228 | +++ tests/mocks/Unity/Screens/Screens.qmltypes 2016-02-10 11:16:44 +0000 |
229 | @@ -0,0 +1,57 @@ |
230 | +import QtQuick.tooling 1.2 |
231 | + |
232 | +// This file describes the plugin-supplied types contained in the library. |
233 | +// It is used for QML tooling purposes only. |
234 | +// |
235 | +// This file was auto-generated by: |
236 | +// 'qmlplugindump -notrelocatable Unity.Screens 0.1 tests/mocks' |
237 | + |
238 | +Module { |
239 | + dependencies: ["QtQuick 2.4"] |
240 | + Component { |
241 | + name: "Screens" |
242 | + prototype: "QAbstractListModel" |
243 | + exports: ["Unity.Screens/Screens 0.1"] |
244 | + exportMetaObjectRevisions: [0] |
245 | + Enum { |
246 | + name: "OutputTypes" |
247 | + values: { |
248 | + "Unknown": 0, |
249 | + "VGA": 1, |
250 | + "DVII": 2, |
251 | + "DVID": 3, |
252 | + "DVIA": 4, |
253 | + "Composite": 5, |
254 | + "SVideo": 6, |
255 | + "LVDS": 7, |
256 | + "Component": 8, |
257 | + "NinePinDIN": 9, |
258 | + "DisplayPort": 10, |
259 | + "HDMIA": 11, |
260 | + "HDMIB": 12, |
261 | + "TV": 13, |
262 | + "EDP": 14 |
263 | + } |
264 | + } |
265 | + Enum { |
266 | + name: "FormFactor" |
267 | + values: { |
268 | + "FormFactorUnknown": 0, |
269 | + "FormFactorPhone": 1, |
270 | + "FormFactorTablet": 2, |
271 | + "FormFactorMonitor": 3, |
272 | + "FormFactorTV": 4, |
273 | + "FormFactorProjector": 5 |
274 | + } |
275 | + } |
276 | + Property { name: "count"; type: "int"; isReadonly: true } |
277 | + Signal { |
278 | + name: "screenAdded" |
279 | + Parameter { name: "screen"; type: "QScreen"; isPointer: true } |
280 | + } |
281 | + Signal { |
282 | + name: "screenRemoved" |
283 | + Parameter { name: "screen"; type: "QScreen"; isPointer: true } |
284 | + } |
285 | + } |
286 | +} |
287 | |
288 | === modified file 'tests/mocks/Unity/Screens/plugin.cpp' |
289 | --- tests/mocks/Unity/Screens/plugin.cpp 2015-12-02 13:23:45 +0000 |
290 | +++ tests/mocks/Unity/Screens/plugin.cpp 2016-02-10 11:16:44 +0000 |
291 | @@ -1,5 +1,5 @@ |
292 | /* |
293 | - * Copyright (C) 2015 Canonical, Ltd. |
294 | + * Copyright (C) 2016 Canonical, Ltd. |
295 | * |
296 | * This program is free software: you can redistribute it and/or modify it under |
297 | * the terms of the GNU Lesser General Public License version 3, as published by |
298 | @@ -26,4 +26,5 @@ |
299 | qRegisterMetaType<QScreen*>("QScreen*"); |
300 | |
301 | qmlRegisterType<Screens>(uri, 0, 1, "Screens"); |
302 | + qRegisterMetaType<Screens::FormFactor>("Screens::FormFactor"); |
303 | } |
304 | |
305 | === modified file 'tests/mocks/Unity/Screens/qmldir' |
306 | --- tests/mocks/Unity/Screens/qmldir 2015-12-02 13:23:45 +0000 |
307 | +++ tests/mocks/Unity/Screens/qmldir 2016-02-10 11:16:44 +0000 |
308 | @@ -1,2 +1,5 @@ |
309 | module Unity.Screens |
310 | plugin MockScreensPlugin |
311 | +typeinfo Screens.qmltypes |
312 | + |
313 | +ScreenWindow 0.1 ScreenWindow.qml |
314 | |
315 | === modified file 'tests/mocks/Unity/Screens/screens.h' |
316 | --- tests/mocks/Unity/Screens/screens.h 2015-12-03 11:45:52 +0000 |
317 | +++ tests/mocks/Unity/Screens/screens.h 2016-02-10 11:16:44 +0000 |
318 | @@ -26,6 +26,7 @@ |
319 | { |
320 | Q_OBJECT |
321 | Q_ENUMS(OutputTypes) |
322 | + Q_ENUMS(FormFactor) |
323 | |
324 | Q_PROPERTY(int count READ count NOTIFY countChanged) |
325 | |
326 | @@ -53,6 +54,15 @@ |
327 | EDP |
328 | }; |
329 | |
330 | + enum FormFactor { |
331 | + FormFactorUnknown, |
332 | + FormFactorPhone, |
333 | + FormFactorTablet, |
334 | + FormFactorMonitor, |
335 | + FormFactorTV, |
336 | + FormFactorProjector, |
337 | + }; |
338 | + |
339 | explicit Screens(QObject *parent = 0); |
340 | virtual ~Screens() noexcept; |
341 | |
342 | @@ -79,4 +89,6 @@ |
343 | QScreen *qScreen = nullptr; |
344 | }; |
345 | |
346 | +Q_DECLARE_METATYPE(Screens::FormFactor) |
347 | + |
348 | #endif // SCREENS_H |
FAILED: Continuous integration, rev:2174 /unity8- jenkins. ubuntu. com/job/ lp-unity8- 1-ci/273/
https:/
Executed test runs:
Click here to trigger a rebuild: /unity8- jenkins. ubuntu. com/job/ lp-unity8- 1-ci/273/ rebuild
https:/