Merge lp:~nick-dedekind/unity8/shell_chrome into lp:unity8
- shell_chrome
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~nick-dedekind/unity8/shell_chrome |
Merge into: | lp:unity8 |
Diff against target: |
835 lines (+341/-27) 20 files modified
CMakeLists.txt (+1/-1) debian/control (+3/-3) qml/Shell.qml (+5/-1) qml/Stages/AbstractStage.qml (+2/-0) qml/Stages/DesktopFullscreenPolicy.qml (+40/-0) qml/Stages/DesktopStage.qml (+61/-9) qml/Stages/PhoneFullscreenPolicy.qml (+53/-0) qml/Stages/PhoneStage.qml (+10/-0) qml/Stages/TabletStage.qml (+10/-0) qml/Stages/WindowResizeArea.qml (+1/-1) tests/mocks/Unity/Application/ApplicationInfo.cpp (+21/-3) tests/mocks/Unity/Application/ApplicationInfo.h (+5/-1) tests/mocks/Unity/Application/ApplicationManager.cpp (+3/-4) tests/mocks/Unity/Application/MirSurface.cpp (+16/-0) tests/mocks/Unity/Application/MirSurface.h (+5/-3) tests/mocks/Unity/Application/MirSurfaceItem.cpp (+9/-0) tests/mocks/Unity/Application/MirSurfaceItem.h (+1/-0) tests/mocks/Unity/Application/Session.cpp (+26/-1) tests/mocks/Unity/Application/Session.h (+7/-0) tests/qmltests/tst_Shell.qml (+62/-0) |
To merge this branch: | bzr merge lp:~nick-dedekind/unity8/shell_chrome |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Unity8 CI Bot | continuous-integration | Needs Fixing | |
Unity Team | Pending | ||
Review via email: mp+286306@code.launchpad.net |
This proposal has been superseded by a proposal from 2016-02-17.
Commit message
Add support for low shell chrome.
Description of the change
* Are there any related MPs required for this MP to build/function as expected? Please list.
https:/
https:/
https:/
* 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?
No
- 2208. By Nick Dedekind
-
whitespace
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2208
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2207
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2208
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Gerry Boland (gerboland) wrote : | # |
+++ qml/Shell.qml
+ property string qmlComponent: {
could be readonly.
+++ qml/Stages/
+ signal stageUnloaded
Why can you not depend on the already-existing Component.
Also when this is fired, the stage as not yet been unloaded. stageAboutToBeU
So I see you use it here:
+ property bool saveStateOnDest
+ Connections {
+ target: root
+ onStageUnloaded: {
+ resizeArea.
+ resizeArea.
+ fullscreenPolic
+ }
+ }
+ Component.
+ if (saveStateOnDes
+ saveWindowState();
+ }
+ }
this is strange code. It looks like you are waiting for 2 events to save the windowState, and save on the first event. This is really strange looking, you need to justify it, and why Component.
+++ qml/Stages/
this doesn't need to be an item, it doesn't contain anything visual. This can just be a single QtObject. You might be able to import QtQml instead of QtQuick too. lastSurface can be readonly too. Indent of the 'if" statement not clear.
I don't understand why it doesn't apply on the first surface. Could you also write a comment to explain the policy?
+++ qml/Stages/
I also suspect this could be a QtObject (am not sure if Connections will work inside QtObject though). It is odd to see "PhoneFullscree
Why does this not have the first surface branch the Desktop policy has?
=== modified file 'qml/Stages/
- property alias requestedWidth: decoratedWindow
- property alias requestedHeight: decoratedWindow
+ property int requestedWidth: -1
+ property int requestedHeight: -1
why? You overriding the requested width/height? Or just because you animate them?
+++ tests/qmltests/
just to confirm you mean to return the bool result of the comparison:
+ controls.
Do we all know that JS returns the result of the last statement, if nothing is explicitly returned?
Gerry Boland (gerboland) wrote : | # |
I still need to test on devices
Unmerged revisions
- 2200. By Launchpad Translations on behalf of unity-team
-
Launchpad automatic translations update.
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2016-02-12 00:12:30 +0000 | |||
3 | +++ CMakeLists.txt 2016-02-17 14:46:08 +0000 | |||
4 | @@ -57,7 +57,7 @@ | |||
5 | 57 | find_package(Qt5Concurrent 5.4 REQUIRED) | 57 | find_package(Qt5Concurrent 5.4 REQUIRED) |
6 | 58 | find_package(Qt5Sql 5.4 REQUIRED) | 58 | find_package(Qt5Sql 5.4 REQUIRED) |
7 | 59 | 59 | ||
9 | 60 | pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=13) | 60 | pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=14) |
10 | 61 | pkg_check_modules(GIO REQUIRED gio-2.0>=2.32) | 61 | pkg_check_modules(GIO REQUIRED gio-2.0>=2.32) |
11 | 62 | pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32) | 62 | pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32) |
12 | 63 | pkg_check_modules(QMENUMODEL REQUIRED qmenumodel) | 63 | pkg_check_modules(QMENUMODEL REQUIRED qmenumodel) |
13 | 64 | 64 | ||
14 | === modified file 'debian/control' | |||
15 | --- debian/control 2016-02-12 00:12:30 +0000 | |||
16 | +++ debian/control 2016-02-17 14:46:08 +0000 | |||
17 | @@ -29,7 +29,7 @@ | |||
18 | 29 | libqt5xmlpatterns5-dev, | 29 | libqt5xmlpatterns5-dev, |
19 | 30 | libsystemsettings-dev, | 30 | libsystemsettings-dev, |
20 | 31 | libudev-dev, | 31 | libudev-dev, |
22 | 32 | libunity-api-dev (>= 7.106), | 32 | libunity-api-dev (>= 7.107), |
23 | 33 | libusermetricsoutput1-dev, | 33 | libusermetricsoutput1-dev, |
24 | 34 | # Need those X11 libs touch emulation from mouse events in manual QML tests on a X11 desktop | 34 | # Need those X11 libs touch emulation from mouse events in manual QML tests on a X11 desktop |
25 | 35 | libx11-dev[!armhf], | 35 | libx11-dev[!armhf], |
26 | @@ -131,7 +131,7 @@ | |||
27 | 131 | qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1627) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1627), | 131 | qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1627) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1627), |
28 | 132 | qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl, | 132 | qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl, |
29 | 133 | ubuntu-thumbnailer-impl-0, | 133 | ubuntu-thumbnailer-impl-0, |
31 | 134 | unity-application-impl-13, | 134 | unity-application-impl-14, |
32 | 135 | unity-notifications-impl-3, | 135 | unity-notifications-impl-3, |
33 | 136 | unity-plugin-scopes | unity-scopes-impl, | 136 | unity-plugin-scopes | unity-scopes-impl, |
34 | 137 | unity-scopes-impl-9, | 137 | unity-scopes-impl-9, |
35 | @@ -177,7 +177,7 @@ | |||
36 | 177 | Depends: ${misc:Depends}, | 177 | Depends: ${misc:Depends}, |
37 | 178 | ${shlibs:Depends}, | 178 | ${shlibs:Depends}, |
38 | 179 | Provides: unity-application-impl, | 179 | Provides: unity-application-impl, |
40 | 180 | unity-application-impl-13, | 180 | unity-application-impl-14, |
41 | 181 | Replaces: unity8-autopilot (<< 8.02+15.04.20150422-0ubuntu1) | 181 | Replaces: unity8-autopilot (<< 8.02+15.04.20150422-0ubuntu1) |
42 | 182 | Description: Fake environment for running Unity 8 shell | 182 | Description: Fake environment for running Unity 8 shell |
43 | 183 | Provides fake implementations of some QML modules used by Unity 8 shell | 183 | Provides fake implementations of some QML modules used by Unity 8 shell |
44 | 184 | 184 | ||
45 | === modified file 'qml/Shell.qml' | |||
46 | --- qml/Shell.qml 2016-01-28 18:25:14 +0000 | |||
47 | +++ qml/Shell.qml 2016-02-17 14:46:08 +0000 | |||
48 | @@ -242,7 +242,7 @@ | |||
49 | 242 | property string usageScenario: shell.usageScenario === "phone" || greeter.hasLockedApp | 242 | property string usageScenario: shell.usageScenario === "phone" || greeter.hasLockedApp |
50 | 243 | ? "phone" | 243 | ? "phone" |
51 | 244 | : shell.usageScenario | 244 | : shell.usageScenario |
53 | 245 | source: { | 245 | property string qmlComponent: { |
54 | 246 | if(shell.mode === "greeter") { | 246 | if(shell.mode === "greeter") { |
55 | 247 | return "Stages/ShimStage.qml" | 247 | return "Stages/ShimStage.qml" |
56 | 248 | } else if (applicationsDisplayLoader.usageScenario === "phone") { | 248 | } else if (applicationsDisplayLoader.usageScenario === "phone") { |
57 | @@ -253,6 +253,10 @@ | |||
58 | 253 | return "Stages/DesktopStage.qml"; | 253 | return "Stages/DesktopStage.qml"; |
59 | 254 | } | 254 | } |
60 | 255 | } | 255 | } |
61 | 256 | onQmlComponentChanged: { | ||
62 | 257 | if (item) item.stageUnloaded(); | ||
63 | 258 | source = qmlComponent; | ||
64 | 259 | } | ||
65 | 256 | 260 | ||
66 | 257 | property bool interactive: tutorial.spreadEnabled | 261 | property bool interactive: tutorial.spreadEnabled |
67 | 258 | && (!greeter || !greeter.shown) | 262 | && (!greeter || !greeter.shown) |
68 | 259 | 263 | ||
69 | === modified file 'qml/Stages/AbstractStage.qml' | |||
70 | --- qml/Stages/AbstractStage.qml 2016-01-14 13:03:20 +0000 | |||
71 | +++ qml/Stages/AbstractStage.qml 2016-02-17 14:46:08 +0000 | |||
72 | @@ -49,6 +49,8 @@ | |||
73 | 49 | | Qt.InvertedPortraitOrientation | 49 | | Qt.InvertedPortraitOrientation |
74 | 50 | | Qt.InvertedLandscapeOrientation | 50 | | Qt.InvertedLandscapeOrientation |
75 | 51 | 51 | ||
76 | 52 | signal stageUnloaded | ||
77 | 53 | |||
78 | 52 | // Shared code for use in stage implementations | 54 | // Shared code for use in stage implementations |
79 | 53 | GSettings { | 55 | GSettings { |
80 | 54 | id: lifecycleExceptions | 56 | id: lifecycleExceptions |
81 | 55 | 57 | ||
82 | === added file 'qml/Stages/DesktopFullscreenPolicy.qml' | |||
83 | --- qml/Stages/DesktopFullscreenPolicy.qml 1970-01-01 00:00:00 +0000 | |||
84 | +++ qml/Stages/DesktopFullscreenPolicy.qml 2016-02-17 14:46:08 +0000 | |||
85 | @@ -0,0 +1,40 @@ | |||
86 | 1 | /* | ||
87 | 2 | * Copyright (C) 2016 Canonical, Ltd. | ||
88 | 3 | * | ||
89 | 4 | * This program is free software; you can redistribute it and/or modify | ||
90 | 5 | * it under the terms of the GNU General Public License as published by | ||
91 | 6 | * the Free Software Foundation; version 3. | ||
92 | 7 | * | ||
93 | 8 | * This program is distributed in the hope that it will be useful, | ||
94 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
95 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
96 | 11 | * GNU General Public License for more details. | ||
97 | 12 | * | ||
98 | 13 | * You should have received a copy of the GNU General Public License | ||
99 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
100 | 15 | */ | ||
101 | 16 | |||
102 | 17 | import QtQuick 2.4 | ||
103 | 18 | import Unity.Application 0.1 | ||
104 | 19 | |||
105 | 20 | Item { | ||
106 | 21 | property bool active: true | ||
107 | 22 | property QtObject application: null | ||
108 | 23 | |||
109 | 24 | QtObject { | ||
110 | 25 | id: priv | ||
111 | 26 | property bool firstTimeSurface: true | ||
112 | 27 | property var lastSurface: application && application.session ? | ||
113 | 28 | application.session.lastSurface : null | ||
114 | 29 | onLastSurfaceChanged: { | ||
115 | 30 | if (!active || !lastSurface) return; | ||
116 | 31 | if (!firstTimeSurface) return; | ||
117 | 32 | firstTimeSurface = false; | ||
118 | 33 | |||
119 | 34 | if (lastSurface.state === Mir.FullscreenState && | ||
120 | 35 | lastSurface.shellChrome === Mir.LowChrome) { | ||
121 | 36 | lastSurface.state = Mir.RestoredState; | ||
122 | 37 | } | ||
123 | 38 | } | ||
124 | 39 | } | ||
125 | 40 | } | ||
126 | 0 | 41 | ||
127 | === modified file 'qml/Stages/DesktopStage.qml' | |||
128 | --- qml/Stages/DesktopStage.qml 2016-02-03 14:00:47 +0000 | |||
129 | +++ qml/Stages/DesktopStage.qml 2016-02-17 14:46:08 +0000 | |||
130 | @@ -254,8 +254,8 @@ | |||
131 | 254 | focus: appId === priv.focusedAppId | 254 | focus: appId === priv.focusedAppId |
132 | 255 | width: decoratedWindow.width | 255 | width: decoratedWindow.width |
133 | 256 | height: decoratedWindow.height | 256 | height: decoratedWindow.height |
136 | 257 | property alias requestedWidth: decoratedWindow.requestedWidth | 257 | property int requestedWidth: -1 |
137 | 258 | property alias requestedHeight: decoratedWindow.requestedHeight | 258 | property int requestedHeight: -1 |
138 | 259 | property alias minimumWidth: decoratedWindow.minimumWidth | 259 | property alias minimumWidth: decoratedWindow.minimumWidth |
139 | 260 | property alias minimumHeight: decoratedWindow.minimumHeight | 260 | property alias minimumHeight: decoratedWindow.minimumHeight |
140 | 261 | property alias maximumWidth: decoratedWindow.maximumWidth | 261 | property alias maximumWidth: decoratedWindow.maximumWidth |
141 | @@ -372,20 +372,40 @@ | |||
142 | 372 | PropertyChanges { | 372 | PropertyChanges { |
143 | 373 | target: appDelegate; | 373 | target: appDelegate; |
144 | 374 | x: 0; y: 0; | 374 | x: 0; y: 0; |
145 | 375 | requestedWidth: root.width; requestedHeight: root.height; | ||
146 | 376 | visuallyMinimized: false; | 375 | visuallyMinimized: false; |
147 | 377 | visuallyMaximized: true | 376 | visuallyMaximized: true |
148 | 378 | } | 377 | } |
149 | 378 | PropertyChanges { | ||
150 | 379 | target: decoratedWindow | ||
151 | 380 | requestedWidth: root.width; | ||
152 | 381 | requestedHeight: root.height; | ||
153 | 382 | } | ||
154 | 379 | }, | 383 | }, |
155 | 380 | State { | 384 | State { |
156 | 381 | name: "maximizedLeft"; when: appDelegate.maximizedLeft && !appDelegate.minimized | 385 | name: "maximizedLeft"; when: appDelegate.maximizedLeft && !appDelegate.minimized |
159 | 382 | PropertyChanges { target: appDelegate; x: 0; y: PanelState.panelHeight; | 386 | PropertyChanges { |
160 | 383 | requestedWidth: root.width/2; requestedHeight: root.height - PanelState.panelHeight } | 387 | target: appDelegate; |
161 | 388 | x: 0; | ||
162 | 389 | y: PanelState.panelHeight; | ||
163 | 390 | } | ||
164 | 391 | PropertyChanges { | ||
165 | 392 | target: decoratedWindow | ||
166 | 393 | requestedWidth: root.width/2 | ||
167 | 394 | requestedHeight: root.height - PanelState.panelHeight | ||
168 | 395 | } | ||
169 | 384 | }, | 396 | }, |
170 | 385 | State { | 397 | State { |
171 | 386 | name: "maximizedRight"; when: appDelegate.maximizedRight && !appDelegate.minimized | 398 | name: "maximizedRight"; when: appDelegate.maximizedRight && !appDelegate.minimized |
174 | 387 | PropertyChanges { target: appDelegate; x: root.width/2; y: PanelState.panelHeight; | 399 | PropertyChanges { |
175 | 388 | requestedWidth: root.width/2; requestedHeight: root.height - PanelState.panelHeight } | 400 | target: appDelegate; |
176 | 401 | x: root.width/2; | ||
177 | 402 | y: PanelState.panelHeight | ||
178 | 403 | } | ||
179 | 404 | PropertyChanges { | ||
180 | 405 | target: decoratedWindow | ||
181 | 406 | requestedWidth: root.width/2; | ||
182 | 407 | requestedHeight: root.height - PanelState.panelHeight | ||
183 | 408 | } | ||
184 | 389 | }, | 409 | }, |
185 | 390 | State { | 410 | State { |
186 | 391 | name: "minimized"; when: appDelegate.minimized | 411 | name: "minimized"; when: appDelegate.minimized |
187 | @@ -405,13 +425,17 @@ | |||
188 | 405 | enabled: appDelegate.animationsEnabled | 425 | enabled: appDelegate.animationsEnabled |
189 | 406 | PropertyAction { target: appDelegate; properties: "visuallyMinimized,visuallyMaximized" } | 426 | PropertyAction { target: appDelegate; properties: "visuallyMinimized,visuallyMaximized" } |
190 | 407 | UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: UbuntuAnimation.FastDuration } | 427 | UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: UbuntuAnimation.FastDuration } |
191 | 428 | UbuntuNumberAnimation { target: decoratedWindow; properties: "requestedWidth,requestedHeight"; duration: UbuntuAnimation.FastDuration } | ||
192 | 408 | }, | 429 | }, |
193 | 409 | Transition { | 430 | Transition { |
194 | 410 | to: "minimized" | 431 | to: "minimized" |
195 | 411 | enabled: appDelegate.animationsEnabled | 432 | enabled: appDelegate.animationsEnabled |
196 | 412 | PropertyAction { target: appDelegate; property: "visuallyMaximized" } | 433 | PropertyAction { target: appDelegate; property: "visuallyMaximized" } |
197 | 413 | SequentialAnimation { | 434 | SequentialAnimation { |
199 | 414 | UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: UbuntuAnimation.FastDuration } | 435 | ParallelAnimation { |
200 | 436 | UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,scale"; duration: UbuntuAnimation.FastDuration } | ||
201 | 437 | UbuntuNumberAnimation { target: decoratedWindow; properties: "requestedWidth,requestedHeight"; duration: UbuntuAnimation.FastDuration } | ||
202 | 438 | } | ||
203 | 415 | PropertyAction { target: appDelegate; property: "visuallyMinimized" } | 439 | PropertyAction { target: appDelegate; property: "visuallyMinimized" } |
204 | 416 | ScriptAction { | 440 | ScriptAction { |
205 | 417 | script: { | 441 | script: { |
206 | @@ -427,7 +451,10 @@ | |||
207 | 427 | enabled: appDelegate.animationsEnabled | 451 | enabled: appDelegate.animationsEnabled |
208 | 428 | PropertyAction { target: appDelegate; property: "visuallyMinimized" } | 452 | PropertyAction { target: appDelegate; property: "visuallyMinimized" } |
209 | 429 | SequentialAnimation { | 453 | SequentialAnimation { |
211 | 430 | UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: UbuntuAnimation.FastDuration } | 454 | ParallelAnimation { |
212 | 455 | UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,scale"; duration: UbuntuAnimation.FastDuration } | ||
213 | 456 | UbuntuNumberAnimation { target: decoratedWindow; properties: "requestedWidth,requestedHeight"; duration: UbuntuAnimation.FastDuration } | ||
214 | 457 | } | ||
215 | 431 | PropertyAction { target: appDelegate; property: "visuallyMaximized" } | 458 | PropertyAction { target: appDelegate; property: "visuallyMaximized" } |
216 | 432 | } | 459 | } |
217 | 433 | } | 460 | } |
218 | @@ -442,6 +469,7 @@ | |||
219 | 442 | } | 469 | } |
220 | 443 | 470 | ||
221 | 444 | WindowResizeArea { | 471 | WindowResizeArea { |
222 | 472 | id: resizeArea | ||
223 | 445 | objectName: "windowResizeArea" | 473 | objectName: "windowResizeArea" |
224 | 446 | target: appDelegate | 474 | target: appDelegate |
225 | 447 | minWidth: units.gu(10) | 475 | minWidth: units.gu(10) |
226 | @@ -452,6 +480,21 @@ | |||
227 | 452 | screenHeight: root.height | 480 | screenHeight: root.height |
228 | 453 | 481 | ||
229 | 454 | onPressed: { ApplicationManager.focusApplication(model.appId) } | 482 | onPressed: { ApplicationManager.focusApplication(model.appId) } |
230 | 483 | |||
231 | 484 | property bool saveStateOnDestruction: true | ||
232 | 485 | Connections { | ||
233 | 486 | target: root | ||
234 | 487 | onStageUnloaded: { | ||
235 | 488 | resizeArea.saveWindowState(); | ||
236 | 489 | resizeArea.saveStateOnDestruction = false; | ||
237 | 490 | fullscreenPolicy.active = false; | ||
238 | 491 | } | ||
239 | 492 | } | ||
240 | 493 | Component.onDestruction: { | ||
241 | 494 | if (saveStateOnDestruction) { | ||
242 | 495 | saveWindowState(); | ||
243 | 496 | } | ||
244 | 497 | } | ||
245 | 455 | } | 498 | } |
246 | 456 | 499 | ||
247 | 457 | DecoratedWindow { | 500 | DecoratedWindow { |
248 | @@ -463,12 +506,21 @@ | |||
249 | 463 | active: ApplicationManager.focusedApplicationId === model.appId | 506 | active: ApplicationManager.focusedApplicationId === model.appId |
250 | 464 | focus: true | 507 | focus: true |
251 | 465 | 508 | ||
252 | 509 | requestedWidth: appDelegate.requestedWidth | ||
253 | 510 | requestedHeight: appDelegate.requestedHeight | ||
254 | 511 | |||
255 | 466 | onClose: ApplicationManager.stopApplication(model.appId) | 512 | onClose: ApplicationManager.stopApplication(model.appId) |
256 | 467 | onMaximize: appDelegate.maximized || appDelegate.maximizedLeft || appDelegate.maximizedRight | 513 | onMaximize: appDelegate.maximized || appDelegate.maximizedLeft || appDelegate.maximizedRight |
257 | 468 | ? appDelegate.restoreFromMaximized() : appDelegate.maximize() | 514 | ? appDelegate.restoreFromMaximized() : appDelegate.maximize() |
258 | 469 | onMinimize: appDelegate.minimize() | 515 | onMinimize: appDelegate.minimize() |
259 | 470 | onDecorationPressed: { ApplicationManager.focusApplication(model.appId) } | 516 | onDecorationPressed: { ApplicationManager.focusApplication(model.appId) } |
260 | 471 | } | 517 | } |
261 | 518 | |||
262 | 519 | DesktopFullscreenPolicy { | ||
263 | 520 | id: fullscreenPolicy | ||
264 | 521 | active: true | ||
265 | 522 | application: decoratedWindow.application | ||
266 | 523 | } | ||
267 | 472 | } | 524 | } |
268 | 473 | } | 525 | } |
269 | 474 | } | 526 | } |
270 | 475 | 527 | ||
271 | === added file 'qml/Stages/PhoneFullscreenPolicy.qml' | |||
272 | --- qml/Stages/PhoneFullscreenPolicy.qml 1970-01-01 00:00:00 +0000 | |||
273 | +++ qml/Stages/PhoneFullscreenPolicy.qml 2016-02-17 14:46:08 +0000 | |||
274 | @@ -0,0 +1,53 @@ | |||
275 | 1 | /* | ||
276 | 2 | * Copyright (C) 2016 Canonical, Ltd. | ||
277 | 3 | * | ||
278 | 4 | * This program is free software; you can redistribute it and/or modify | ||
279 | 5 | * it under the terms of the GNU General Public License as published by | ||
280 | 6 | * the Free Software Foundation; version 3. | ||
281 | 7 | * | ||
282 | 8 | * This program is distributed in the hope that it will be useful, | ||
283 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
284 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
285 | 11 | * GNU General Public License for more details. | ||
286 | 12 | * | ||
287 | 13 | * You should have received a copy of the GNU General Public License | ||
288 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
289 | 15 | */ | ||
290 | 16 | |||
291 | 17 | import QtQuick 2.4 | ||
292 | 18 | import Unity.Application 0.1 | ||
293 | 19 | |||
294 | 20 | Item { | ||
295 | 21 | property bool active: true | ||
296 | 22 | property QtObject application: null | ||
297 | 23 | |||
298 | 24 | QtObject { | ||
299 | 25 | id: priv | ||
300 | 26 | property var lastSurface: application && application.session ? | ||
301 | 27 | application.session.lastSurface : null | ||
302 | 28 | onLastSurfaceChanged: { | ||
303 | 29 | if (!active || !lastSurface) return; | ||
304 | 30 | if (lastSurface.shellChrome === Mir.LowChrome) { | ||
305 | 31 | lastSurface.state = Mir.FullscreenState; | ||
306 | 32 | } | ||
307 | 33 | } | ||
308 | 34 | } | ||
309 | 35 | |||
310 | 36 | Connections { | ||
311 | 37 | target: priv.lastSurface | ||
312 | 38 | onShellChromeChanged: { | ||
313 | 39 | if (!active || !priv.lastSurface) return; | ||
314 | 40 | if (priv.lastSurface.shellChrome === Mir.LowChrome || priv.lastSurface.state == Mir.FullscreenState) { | ||
315 | 41 | priv.lastSurface.state = Mir.FullscreenState; | ||
316 | 42 | } else { | ||
317 | 43 | priv.lastSurface.state = Mir.RestoredState; | ||
318 | 44 | } | ||
319 | 45 | } | ||
320 | 46 | onStateChanged: { | ||
321 | 47 | if (!active) return; | ||
322 | 48 | if (priv.lastSurface.state === Mir.RestoredState && priv.lastSurface.shellChrome === Mir.LowChrome) { | ||
323 | 49 | priv.lastSurface.state = Mir.FullscreenState; | ||
324 | 50 | } | ||
325 | 51 | } | ||
326 | 52 | } | ||
327 | 53 | } | ||
328 | 0 | 54 | ||
329 | === modified file 'qml/Stages/PhoneStage.qml' | |||
330 | --- qml/Stages/PhoneStage.qml 2016-01-14 13:03:20 +0000 | |||
331 | +++ qml/Stages/PhoneStage.qml 2016-02-17 14:46:08 +0000 | |||
332 | @@ -580,6 +580,16 @@ | |||
333 | 580 | property: "focusedAppOrientationChangesEnabled" | 580 | property: "focusedAppOrientationChangesEnabled" |
334 | 581 | value: orientationChangesEnabled | 581 | value: orientationChangesEnabled |
335 | 582 | } | 582 | } |
336 | 583 | |||
337 | 584 | PhoneFullscreenPolicy { | ||
338 | 585 | id: fullscreenPolicy | ||
339 | 586 | application: appDelegate.application | ||
340 | 587 | |||
341 | 588 | Connections { | ||
342 | 589 | target: root | ||
343 | 590 | onStageUnloaded: fullscreenPolicy.active = false | ||
344 | 591 | } | ||
345 | 592 | } | ||
346 | 583 | } | 593 | } |
347 | 584 | } | 594 | } |
348 | 585 | } | 595 | } |
349 | 586 | 596 | ||
350 | === modified file 'qml/Stages/TabletStage.qml' | |||
351 | --- qml/Stages/TabletStage.qml 2016-01-14 13:03:20 +0000 | |||
352 | +++ qml/Stages/TabletStage.qml 2016-02-17 14:46:08 +0000 | |||
353 | @@ -743,6 +743,16 @@ | |||
354 | 743 | period: (spreadView.positionMarker2 - spreadView.positionMarker1) / 3 | 743 | period: (spreadView.positionMarker2 - spreadView.positionMarker1) / 3 |
355 | 744 | progress: spreadTile.progress - spreadView.positionMarker1 | 744 | progress: spreadTile.progress - spreadView.positionMarker1 |
356 | 745 | } | 745 | } |
357 | 746 | |||
358 | 747 | PhoneFullscreenPolicy { | ||
359 | 748 | id: fullscreenPolicy | ||
360 | 749 | application: spreadTile.application | ||
361 | 750 | |||
362 | 751 | Connections { | ||
363 | 752 | target: root | ||
364 | 753 | onStageUnloaded: fullscreenPolicy.active = false | ||
365 | 754 | } | ||
366 | 755 | } | ||
367 | 746 | } | 756 | } |
368 | 747 | } | 757 | } |
369 | 748 | } | 758 | } |
370 | 749 | 759 | ||
371 | === modified file 'qml/Stages/WindowResizeArea.qml' | |||
372 | --- qml/Stages/WindowResizeArea.qml 2016-02-03 14:00:47 +0000 | |||
373 | +++ qml/Stages/WindowResizeArea.qml 2016-02-17 14:46:08 +0000 | |||
374 | @@ -84,7 +84,7 @@ | |||
375 | 84 | priv.updateNormalGeometry(); | 84 | priv.updateNormalGeometry(); |
376 | 85 | } | 85 | } |
377 | 86 | 86 | ||
379 | 87 | Component.onDestruction: { | 87 | function saveWindowState() { |
380 | 88 | windowStateStorage.saveState(root.windowId, target.state == "maximized" ? WindowStateStorage.WindowStateMaximized : WindowStateStorage.WindowStateNormal) | 88 | windowStateStorage.saveState(root.windowId, target.state == "maximized" ? WindowStateStorage.WindowStateMaximized : WindowStateStorage.WindowStateNormal) |
381 | 89 | windowStateStorage.saveGeometry(root.windowId, Qt.rect(priv.normalX, priv.normalY, priv.normalWidth, priv.normalHeight)) | 89 | windowStateStorage.saveGeometry(root.windowId, Qt.rect(priv.normalX, priv.normalY, priv.normalWidth, priv.normalHeight)) |
382 | 90 | } | 90 | } |
383 | 91 | 91 | ||
384 | === modified file 'tests/mocks/Unity/Application/ApplicationInfo.cpp' | |||
385 | --- tests/mocks/Unity/Application/ApplicationInfo.cpp 2016-01-22 19:44:56 +0000 | |||
386 | +++ tests/mocks/Unity/Application/ApplicationInfo.cpp 2016-02-17 14:46:08 +0000 | |||
387 | @@ -44,6 +44,7 @@ | |||
388 | 44 | , m_isTouchApp(true) | 44 | , m_isTouchApp(true) |
389 | 45 | , m_exemptFromLifecycle(false) | 45 | , m_exemptFromLifecycle(false) |
390 | 46 | , m_manualSurfaceCreation(false) | 46 | , m_manualSurfaceCreation(false) |
391 | 47 | , m_shellChrome(Mir::NormalChrome) | ||
392 | 47 | { | 48 | { |
393 | 48 | } | 49 | } |
394 | 49 | 50 | ||
395 | @@ -63,6 +64,7 @@ | |||
396 | 63 | , m_isTouchApp(true) | 64 | , m_isTouchApp(true) |
397 | 64 | , m_exemptFromLifecycle(false) | 65 | , m_exemptFromLifecycle(false) |
398 | 65 | , m_manualSurfaceCreation(false) | 66 | , m_manualSurfaceCreation(false) |
399 | 67 | , m_shellChrome(Mir::NormalChrome) | ||
400 | 66 | { | 68 | { |
401 | 67 | } | 69 | } |
402 | 68 | 70 | ||
403 | @@ -102,9 +104,11 @@ | |||
404 | 102 | if (m_session) { | 104 | if (m_session) { |
405 | 103 | m_session->setApplication(this); | 105 | m_session->setApplication(this); |
406 | 104 | m_session->setParent(this); | 106 | m_session->setParent(this); |
407 | 107 | m_session->setFullscreen(m_fullscreen); | ||
408 | 105 | SessionManager::singleton()->registerSession(m_session); | 108 | SessionManager::singleton()->registerSession(m_session); |
409 | 106 | connect(m_session, &Session::surfaceAdded, | 109 | connect(m_session, &Session::surfaceAdded, |
410 | 107 | this, &ApplicationInfo::onSessionSurfaceAdded); | 110 | this, &ApplicationInfo::onSessionSurfaceAdded); |
411 | 111 | connect(m_session, &Session::fullscreenChanged, this, &ApplicationInfo::fullscreenChanged); | ||
412 | 108 | 112 | ||
413 | 109 | if (!m_manualSurfaceCreation) { | 113 | if (!m_manualSurfaceCreation) { |
414 | 110 | QTimer::singleShot(500, m_session, &Session::createSurface); | 114 | QTimer::singleShot(500, m_session, &Session::createSurface); |
415 | @@ -191,12 +195,17 @@ | |||
416 | 191 | 195 | ||
417 | 192 | void ApplicationInfo::setFullscreen(bool value) | 196 | void ApplicationInfo::setFullscreen(bool value) |
418 | 193 | { | 197 | { |
422 | 194 | if (value != m_fullscreen) { | 198 | m_fullscreen = value; |
423 | 195 | m_fullscreen = value; | 199 | if (m_session) { |
424 | 196 | Q_EMIT fullscreenChanged(value); | 200 | m_session->setFullscreen(value); |
425 | 197 | } | 201 | } |
426 | 198 | } | 202 | } |
427 | 199 | 203 | ||
428 | 204 | bool ApplicationInfo::fullscreen() const | ||
429 | 205 | { | ||
430 | 206 | return m_session ? m_session->fullscreen() : false; | ||
431 | 207 | } | ||
432 | 208 | |||
433 | 200 | void ApplicationInfo::setManualSurfaceCreation(bool value) | 209 | void ApplicationInfo::setManualSurfaceCreation(bool value) |
434 | 201 | { | 210 | { |
435 | 202 | if (value != m_manualSurfaceCreation) { | 211 | if (value != m_manualSurfaceCreation) { |
436 | @@ -262,6 +271,7 @@ | |||
437 | 262 | } else { | 271 | } else { |
438 | 263 | setState(Suspended); | 272 | setState(Suspended); |
439 | 264 | } | 273 | } |
440 | 274 | surface->setShellChrome(m_shellChrome); | ||
441 | 265 | } | 275 | } |
442 | 266 | } | 276 | } |
443 | 267 | 277 | ||
444 | @@ -291,3 +301,11 @@ | |||
445 | 291 | Q_EMIT initialSurfaceSizeChanged(m_initialSurfaceSize); | 301 | Q_EMIT initialSurfaceSizeChanged(m_initialSurfaceSize); |
446 | 292 | } | 302 | } |
447 | 293 | } | 303 | } |
448 | 304 | |||
449 | 305 | void ApplicationInfo::setShellChrome(Mir::ShellChrome shellChrome) | ||
450 | 306 | { | ||
451 | 307 | m_shellChrome = shellChrome; | ||
452 | 308 | if (m_session && m_session->lastSurface()) { | ||
453 | 309 | m_session->lastSurface()->setShellChrome(shellChrome); | ||
454 | 310 | } | ||
455 | 311 | } | ||
456 | 294 | 312 | ||
457 | === modified file 'tests/mocks/Unity/Application/ApplicationInfo.h' | |||
458 | --- tests/mocks/Unity/Application/ApplicationInfo.h 2016-01-19 21:41:34 +0000 | |||
459 | +++ tests/mocks/Unity/Application/ApplicationInfo.h 2016-02-17 14:46:08 +0000 | |||
460 | @@ -24,6 +24,7 @@ | |||
461 | 24 | 24 | ||
462 | 25 | // unity-api | 25 | // unity-api |
463 | 26 | #include <unity/shell/application/ApplicationInfoInterface.h> | 26 | #include <unity/shell/application/ApplicationInfoInterface.h> |
464 | 27 | #include <unity/shell/application/Mir.h> | ||
465 | 27 | 28 | ||
466 | 28 | using namespace unity::shell::application; | 29 | using namespace unity::shell::application; |
467 | 29 | 30 | ||
468 | @@ -78,7 +79,7 @@ | |||
469 | 78 | QString screenshot() const { return m_screenshotFileName; } | 79 | QString screenshot() const { return m_screenshotFileName; } |
470 | 79 | 80 | ||
471 | 80 | void setFullscreen(bool value); | 81 | void setFullscreen(bool value); |
473 | 81 | bool fullscreen() const { return m_fullscreen; } | 82 | bool fullscreen() const; |
474 | 82 | 83 | ||
475 | 83 | Qt::ScreenOrientations supportedOrientations() const override; | 84 | Qt::ScreenOrientations supportedOrientations() const override; |
476 | 84 | void setSupportedOrientations(Qt::ScreenOrientations orientations); | 85 | void setSupportedOrientations(Qt::ScreenOrientations orientations); |
477 | @@ -97,6 +98,8 @@ | |||
478 | 97 | 98 | ||
479 | 98 | QSize initialSurfaceSize() const override; | 99 | QSize initialSurfaceSize() const override; |
480 | 99 | void setInitialSurfaceSize(const QSize &size) override; | 100 | void setInitialSurfaceSize(const QSize &size) override; |
481 | 101 | |||
482 | 102 | Q_INVOKABLE void setShellChrome(Mir::ShellChrome shellChrome); | ||
483 | 100 | public: | 103 | public: |
484 | 101 | void setSession(Session* session); | 104 | void setSession(Session* session); |
485 | 102 | Session* session() const { return m_session; } | 105 | Session* session() const { return m_session; } |
486 | @@ -134,6 +137,7 @@ | |||
487 | 134 | QSize m_initialSurfaceSize; | 137 | QSize m_initialSurfaceSize; |
488 | 135 | 138 | ||
489 | 136 | bool m_manualSurfaceCreation; | 139 | bool m_manualSurfaceCreation; |
490 | 140 | Mir::ShellChrome m_shellChrome; | ||
491 | 137 | }; | 141 | }; |
492 | 138 | 142 | ||
493 | 139 | Q_DECLARE_METATYPE(ApplicationInfo*) | 143 | Q_DECLARE_METATYPE(ApplicationInfo*) |
494 | 140 | 144 | ||
495 | === modified file 'tests/mocks/Unity/Application/ApplicationManager.cpp' | |||
496 | --- tests/mocks/Unity/Application/ApplicationManager.cpp 2015-12-03 18:10:39 +0000 | |||
497 | +++ tests/mocks/Unity/Application/ApplicationManager.cpp 2016-02-17 14:46:08 +0000 | |||
498 | @@ -336,6 +336,7 @@ | |||
499 | 336 | application->setName("Camera"); | 336 | application->setName("Camera"); |
500 | 337 | application->setScreenshotId("camera"); | 337 | application->setScreenshotId("camera"); |
501 | 338 | application->setIconId("camera"); | 338 | application->setIconId("camera"); |
502 | 339 | application->setShellChrome(Mir::LowChrome); | ||
503 | 339 | application->setFullscreen(true); | 340 | application->setFullscreen(true); |
504 | 340 | application->setSupportedOrientations(Qt::PortraitOrientation | 341 | application->setSupportedOrientations(Qt::PortraitOrientation |
505 | 341 | | Qt::LandscapeOrientation | 342 | | Qt::LandscapeOrientation |
506 | @@ -349,7 +350,7 @@ | |||
507 | 349 | application->setName("Gallery"); | 350 | application->setName("Gallery"); |
508 | 350 | application->setScreenshotId("gallery"); | 351 | application->setScreenshotId("gallery"); |
509 | 351 | application->setIconId("gallery"); | 352 | application->setIconId("gallery"); |
511 | 352 | application->setFullscreen(true); | 353 | application->setShellChrome(Mir::LowChrome); |
512 | 353 | application->setStage(ApplicationInfo::MainStage); | 354 | application->setStage(ApplicationInfo::MainStage); |
513 | 354 | m_availableApplications.append(application); | 355 | m_availableApplications.append(application); |
514 | 355 | 356 | ||
515 | @@ -363,7 +364,7 @@ | |||
516 | 363 | 364 | ||
517 | 364 | application = new ApplicationInfo(this); | 365 | application = new ApplicationInfo(this); |
518 | 365 | application->setAppId("webbrowser-app"); | 366 | application->setAppId("webbrowser-app"); |
520 | 366 | application->setFullscreen(true); | 367 | application->setShellChrome(Mir::LowChrome); |
521 | 367 | application->setName("Browser"); | 368 | application->setName("Browser"); |
522 | 368 | application->setScreenshotId("browser"); | 369 | application->setScreenshotId("browser"); |
523 | 369 | application->setIconId("browser"); | 370 | application->setIconId("browser"); |
524 | @@ -389,7 +390,6 @@ | |||
525 | 389 | application->setName("GMail"); | 390 | application->setName("GMail"); |
526 | 390 | application->setIconId("gmail"); | 391 | application->setIconId("gmail"); |
527 | 391 | application->setScreenshotId("gmail-webapp.svg"); | 392 | application->setScreenshotId("gmail-webapp.svg"); |
528 | 392 | application->setFullscreen(false); | ||
529 | 393 | application->setStage(ApplicationInfo::MainStage); | 393 | application->setStage(ApplicationInfo::MainStage); |
530 | 394 | application->setSupportedOrientations(Qt::PortraitOrientation | 394 | application->setSupportedOrientations(Qt::PortraitOrientation |
531 | 395 | | Qt::LandscapeOrientation | 395 | | Qt::LandscapeOrientation |
532 | @@ -402,7 +402,6 @@ | |||
533 | 402 | application->setName("Music"); | 402 | application->setName("Music"); |
534 | 403 | application->setIconId("soundcloud"); | 403 | application->setIconId("soundcloud"); |
535 | 404 | application->setScreenshotId("music"); | 404 | application->setScreenshotId("music"); |
536 | 405 | application->setFullscreen(false); | ||
537 | 406 | application->setStage(ApplicationInfo::MainStage); | 405 | application->setStage(ApplicationInfo::MainStage); |
538 | 407 | application->setSupportedOrientations(Qt::PortraitOrientation | 406 | application->setSupportedOrientations(Qt::PortraitOrientation |
539 | 408 | | Qt::LandscapeOrientation | 407 | | Qt::LandscapeOrientation |
540 | 409 | 408 | ||
541 | === modified file 'tests/mocks/Unity/Application/MirSurface.cpp' | |||
542 | --- tests/mocks/Unity/Application/MirSurface.cpp 2015-11-30 18:25:47 +0000 | |||
543 | +++ tests/mocks/Unity/Application/MirSurface.cpp 2016-02-17 14:46:08 +0000 | |||
544 | @@ -36,6 +36,7 @@ | |||
545 | 36 | , m_width(-1) | 36 | , m_width(-1) |
546 | 37 | , m_height(-1) | 37 | , m_height(-1) |
547 | 38 | , m_slowToResize(false) | 38 | , m_slowToResize(false) |
548 | 39 | , m_shellChrome(Mir::NormalChrome) | ||
549 | 39 | { | 40 | { |
550 | 40 | // qDebug() << "MirSurface::MirSurface() " << name; | 41 | // qDebug() << "MirSurface::MirSurface() " << name; |
551 | 41 | m_delayedResizeTimer.setInterval(600); | 42 | m_delayedResizeTimer.setInterval(600); |
552 | @@ -130,6 +131,21 @@ | |||
553 | 130 | } | 131 | } |
554 | 131 | 132 | ||
555 | 132 | 133 | ||
556 | 134 | Mir::ShellChrome MirSurface::shellChrome() const | ||
557 | 135 | { | ||
558 | 136 | return m_shellChrome; | ||
559 | 137 | } | ||
560 | 138 | |||
561 | 139 | void MirSurface::setShellChrome(Mir::ShellChrome shellChrome) | ||
562 | 140 | { | ||
563 | 141 | if (shellChrome == m_shellChrome) | ||
564 | 142 | return; | ||
565 | 143 | |||
566 | 144 | m_shellChrome = shellChrome; | ||
567 | 145 | Q_EMIT shellChromeChanged(shellChrome); | ||
568 | 146 | } | ||
569 | 147 | |||
570 | 148 | |||
571 | 133 | 149 | ||
572 | 134 | void MirSurface::registerView(qintptr viewId) | 150 | void MirSurface::registerView(qintptr viewId) |
573 | 135 | { | 151 | { |
574 | 136 | 152 | ||
575 | === modified file 'tests/mocks/Unity/Application/MirSurface.h' | |||
576 | --- tests/mocks/Unity/Application/MirSurface.h 2015-11-30 18:25:47 +0000 | |||
577 | +++ tests/mocks/Unity/Application/MirSurface.h 2016-02-17 14:46:08 +0000 | |||
578 | @@ -73,10 +73,13 @@ | |||
579 | 73 | int widthIncrement() const override { return m_widthIncrement; } | 73 | int widthIncrement() const override { return m_widthIncrement; } |
580 | 74 | int heightIncrement() const override { return m_heightIncrement; } | 74 | int heightIncrement() const override { return m_heightIncrement; } |
581 | 75 | 75 | ||
582 | 76 | Mir::ShellChrome shellChrome() const override; | ||
583 | 77 | |||
584 | 76 | //// | 78 | //// |
585 | 77 | // API for tests | 79 | // API for tests |
586 | 78 | 80 | ||
587 | 79 | Q_INVOKABLE void setLive(bool live); | 81 | Q_INVOKABLE void setLive(bool live); |
588 | 82 | Q_INVOKABLE void setShellChrome(Mir::ShellChrome shellChrome); | ||
589 | 80 | 83 | ||
590 | 81 | void registerView(qintptr viewId); | 84 | void registerView(qintptr viewId); |
591 | 82 | void unregisterView(qintptr viewId); | 85 | void unregisterView(qintptr viewId); |
592 | @@ -108,9 +111,6 @@ | |||
593 | 108 | void setActiveFocus(bool); | 111 | void setActiveFocus(bool); |
594 | 109 | 112 | ||
595 | 110 | Q_SIGNALS: | 113 | Q_SIGNALS: |
596 | 111 | void stateChanged(Mir::State); | ||
597 | 112 | void liveChanged(bool live); | ||
598 | 113 | void orientationAngleChanged(Mir::OrientationAngle angle); | ||
599 | 114 | void widthChanged(); | 114 | void widthChanged(); |
600 | 115 | void heightChanged(); | 115 | void heightChanged(); |
601 | 116 | void slowToResizeChanged(); | 116 | void slowToResizeChanged(); |
602 | @@ -151,6 +151,8 @@ | |||
603 | 151 | QSize m_delayedResize; | 151 | QSize m_delayedResize; |
604 | 152 | QSize m_pendingResize; | 152 | QSize m_pendingResize; |
605 | 153 | 153 | ||
606 | 154 | Mir::ShellChrome m_shellChrome; | ||
607 | 155 | |||
608 | 154 | struct View { | 156 | struct View { |
609 | 155 | bool visible; | 157 | bool visible; |
610 | 156 | }; | 158 | }; |
611 | 157 | 159 | ||
612 | === modified file 'tests/mocks/Unity/Application/MirSurfaceItem.cpp' | |||
613 | --- tests/mocks/Unity/Application/MirSurfaceItem.cpp 2016-01-25 15:00:31 +0000 | |||
614 | +++ tests/mocks/Unity/Application/MirSurfaceItem.cpp 2016-02-17 14:46:08 +0000 | |||
615 | @@ -100,6 +100,15 @@ | |||
616 | 100 | } | 100 | } |
617 | 101 | } | 101 | } |
618 | 102 | 102 | ||
619 | 103 | Mir::ShellChrome MirSurfaceItem::shellChrome() const | ||
620 | 104 | { | ||
621 | 105 | if (m_qmlSurface) { | ||
622 | 106 | return m_qmlSurface->shellChrome(); | ||
623 | 107 | } else { | ||
624 | 108 | return Mir::NormalChrome; | ||
625 | 109 | } | ||
626 | 110 | } | ||
627 | 111 | |||
628 | 103 | Mir::OrientationAngle MirSurfaceItem::orientationAngle() const | 112 | Mir::OrientationAngle MirSurfaceItem::orientationAngle() const |
629 | 104 | { | 113 | { |
630 | 105 | if (m_qmlSurface) { | 114 | if (m_qmlSurface) { |
631 | 106 | 115 | ||
632 | === modified file 'tests/mocks/Unity/Application/MirSurfaceItem.h' | |||
633 | --- tests/mocks/Unity/Application/MirSurfaceItem.h 2016-01-25 15:00:31 +0000 | |||
634 | +++ tests/mocks/Unity/Application/MirSurfaceItem.h 2016-02-17 14:46:08 +0000 | |||
635 | @@ -47,6 +47,7 @@ | |||
636 | 47 | Mir::Type type() const override; | 47 | Mir::Type type() const override; |
637 | 48 | QString name() const override; | 48 | QString name() const override; |
638 | 49 | bool live() const override; | 49 | bool live() const override; |
639 | 50 | Mir::ShellChrome shellChrome() const override; | ||
640 | 50 | 51 | ||
641 | 51 | Mir::State surfaceState() const override; | 52 | Mir::State surfaceState() const override; |
642 | 52 | void setSurfaceState(Mir::State) override {} | 53 | void setSurfaceState(Mir::State) override {} |
643 | 53 | 54 | ||
644 | === modified file 'tests/mocks/Unity/Application/Session.cpp' | |||
645 | --- tests/mocks/Unity/Application/Session.cpp 2015-12-01 12:17:24 +0000 | |||
646 | +++ tests/mocks/Unity/Application/Session.cpp 2016-02-17 14:46:08 +0000 | |||
647 | @@ -34,6 +34,7 @@ | |||
648 | 34 | , m_surface(nullptr) | 34 | , m_surface(nullptr) |
649 | 35 | , m_parentSession(nullptr) | 35 | , m_parentSession(nullptr) |
650 | 36 | , m_children(new SessionModel(this)) | 36 | , m_children(new SessionModel(this)) |
651 | 37 | , m_fullscreen(false) | ||
652 | 37 | { | 38 | { |
653 | 38 | // qDebug() << "Session::Session() " << this->name(); | 39 | // qDebug() << "Session::Session() " << this->name(); |
654 | 39 | 40 | ||
655 | @@ -71,6 +72,25 @@ | |||
656 | 71 | deleteLater(); | 72 | deleteLater(); |
657 | 72 | } | 73 | } |
658 | 73 | 74 | ||
659 | 75 | void Session::updateFullscreenProperty() | ||
660 | 76 | { | ||
661 | 77 | if (m_surfaces.rowCount() > 0) { | ||
662 | 78 | // TODO: Figure out something better | ||
663 | 79 | setFullscreen(lastSurface()->state() == Mir::FullscreenState); | ||
664 | 80 | } else { | ||
665 | 81 | // Keep the current value of the fullscreen property until we get a new | ||
666 | 82 | // surface | ||
667 | 83 | } | ||
668 | 84 | } | ||
669 | 85 | |||
670 | 86 | void Session::setFullscreen(bool fullscreen) | ||
671 | 87 | { | ||
672 | 88 | if (m_fullscreen != fullscreen) { | ||
673 | 89 | m_fullscreen = fullscreen; | ||
674 | 90 | Q_EMIT fullscreenChanged(m_fullscreen); | ||
675 | 91 | } | ||
676 | 92 | } | ||
677 | 93 | |||
678 | 74 | void Session::setApplication(ApplicationInfo* application) | 94 | void Session::setApplication(ApplicationInfo* application) |
679 | 75 | { | 95 | { |
680 | 76 | if (m_application == application) | 96 | if (m_application == application) |
681 | @@ -82,15 +102,18 @@ | |||
682 | 82 | 102 | ||
683 | 83 | void Session::appendSurface(MirSurface* surface) | 103 | void Session::appendSurface(MirSurface* surface) |
684 | 84 | { | 104 | { |
686 | 85 | // qDebug() << "Session::appendSurface - session=" << name() << "surface=" << surface; | 105 | qDebug() << "Session::appendSurface - session=" << name() << "surface=" << surface; |
687 | 86 | 106 | ||
688 | 87 | m_surfaces.insert(m_surfaces.rowCount(), surface); | 107 | m_surfaces.insert(m_surfaces.rowCount(), surface); |
689 | 88 | 108 | ||
690 | 109 | connect(surface, &MirSurfaceInterface::stateChanged, this, &Session::updateFullscreenProperty); | ||
691 | 89 | connect(surface, &QObject::destroyed, | 110 | connect(surface, &QObject::destroyed, |
692 | 90 | this, [this, surface]() { this->removeSurface(surface); }); | 111 | this, [this, surface]() { this->removeSurface(surface); }); |
693 | 91 | 112 | ||
694 | 92 | Q_EMIT lastSurfaceChanged(surface); | 113 | Q_EMIT lastSurfaceChanged(surface); |
695 | 93 | Q_EMIT surfaceAdded(surface); | 114 | Q_EMIT surfaceAdded(surface); |
696 | 115 | |||
697 | 116 | updateFullscreenProperty(); | ||
698 | 94 | } | 117 | } |
699 | 95 | 118 | ||
700 | 96 | void Session::removeSurface(MirSurface* surface) | 119 | void Session::removeSurface(MirSurface* surface) |
701 | @@ -99,6 +122,8 @@ | |||
702 | 99 | if (m_surfaces.contains(surface)) { | 122 | if (m_surfaces.contains(surface)) { |
703 | 100 | m_surfaces.remove(surface); | 123 | m_surfaces.remove(surface); |
704 | 101 | } | 124 | } |
705 | 125 | |||
706 | 126 | updateFullscreenProperty(); | ||
707 | 102 | } | 127 | } |
708 | 103 | 128 | ||
709 | 104 | void Session::setScreenshot(const QUrl& screenshot) | 129 | void Session::setScreenshot(const QUrl& screenshot) |
710 | 105 | 130 | ||
711 | === modified file 'tests/mocks/Unity/Application/Session.h' | |||
712 | --- tests/mocks/Unity/Application/Session.h 2015-12-01 12:17:24 +0000 | |||
713 | +++ tests/mocks/Unity/Application/Session.h 2016-02-17 14:46:08 +0000 | |||
714 | @@ -47,6 +47,7 @@ | |||
715 | 47 | //getters | 47 | //getters |
716 | 48 | QString name() const { return m_name; } | 48 | QString name() const { return m_name; } |
717 | 49 | bool live() const { return m_live; } | 49 | bool live() const { return m_live; } |
718 | 50 | bool fullscreen() const { return m_fullscreen; } | ||
719 | 50 | ApplicationInfo* application() const { return m_application; } | 51 | ApplicationInfo* application() const { return m_application; } |
720 | 51 | MirSurface *lastSurface() const; | 52 | MirSurface *lastSurface() const; |
721 | 52 | ObjectListModel<MirSurface>* surfaces() const; | 53 | ObjectListModel<MirSurface>* surfaces() const; |
722 | @@ -57,6 +58,7 @@ | |||
723 | 57 | void removeSurface(MirSurface* surface); | 58 | void removeSurface(MirSurface* surface); |
724 | 58 | void setScreenshot(const QUrl& m_screenshot); | 59 | void setScreenshot(const QUrl& m_screenshot); |
725 | 59 | void setLive(bool live); | 60 | void setLive(bool live); |
726 | 61 | void setFullscreen(bool fullscreen); | ||
727 | 60 | 62 | ||
728 | 61 | Q_INVOKABLE void addChildSession(Session* session); | 63 | Q_INVOKABLE void addChildSession(Session* session); |
729 | 62 | void insertChildSession(uint index, Session* session); | 64 | void insertChildSession(uint index, Session* session); |
730 | @@ -68,6 +70,7 @@ | |||
731 | 68 | void liveChanged(bool live); | 70 | void liveChanged(bool live); |
732 | 69 | void surfaceAdded(MirSurface *surface); | 71 | void surfaceAdded(MirSurface *surface); |
733 | 70 | void lastSurfaceChanged(MirSurface *surface); | 72 | void lastSurfaceChanged(MirSurface *surface); |
734 | 73 | void fullscreenChanged(bool fullscreen); | ||
735 | 71 | 74 | ||
736 | 72 | // internal mock use | 75 | // internal mock use |
737 | 73 | void deregister(); | 76 | void deregister(); |
738 | @@ -75,6 +78,9 @@ | |||
739 | 75 | public Q_SLOTS: | 78 | public Q_SLOTS: |
740 | 76 | Q_INVOKABLE void createSurface(); | 79 | Q_INVOKABLE void createSurface(); |
741 | 77 | 80 | ||
742 | 81 | private Q_SLOTS: | ||
743 | 82 | void updateFullscreenProperty(); | ||
744 | 83 | |||
745 | 78 | private: | 84 | private: |
746 | 79 | SessionModel* childSessions() const; | 85 | SessionModel* childSessions() const; |
747 | 80 | void setParentSession(Session* session); | 86 | void setParentSession(Session* session); |
748 | @@ -87,6 +93,7 @@ | |||
749 | 87 | Session* m_parentSession; | 93 | Session* m_parentSession; |
750 | 88 | SessionModel* m_children; | 94 | SessionModel* m_children; |
751 | 89 | ObjectListModel<MirSurface> m_surfaces; | 95 | ObjectListModel<MirSurface> m_surfaces; |
752 | 96 | bool m_fullscreen; | ||
753 | 90 | 97 | ||
754 | 91 | friend class ApplicationTestInterface; | 98 | friend class ApplicationTestInterface; |
755 | 92 | }; | 99 | }; |
756 | 93 | 100 | ||
757 | === modified file 'tests/qmltests/tst_Shell.qml' | |||
758 | --- tests/qmltests/tst_Shell.qml 2016-02-12 00:11:28 +0000 | |||
759 | +++ tests/qmltests/tst_Shell.qml 2016-02-17 14:46:08 +0000 | |||
760 | @@ -139,6 +139,9 @@ | |||
761 | 139 | anchors.right: root.right | 139 | anchors.right: root.right |
762 | 140 | width: units.gu(30) | 140 | width: units.gu(30) |
763 | 141 | 141 | ||
764 | 142 | property var focusedApp: ApplicationManager.findApplication(ApplicationManager.focusedApplicationId) | ||
765 | 143 | property var focusedSurface: focusedApp && focusedApp.session ? focusedApp.session.lastSurface : null | ||
766 | 144 | |||
767 | 142 | Rectangle { | 145 | Rectangle { |
768 | 143 | id: controlRect | 146 | id: controlRect |
769 | 144 | anchors { left: parent.left; right: parent.right } | 147 | anchors { left: parent.left; right: parent.right } |
770 | @@ -234,6 +237,65 @@ | |||
771 | 234 | appId: modelData | 237 | appId: modelData |
772 | 235 | } | 238 | } |
773 | 236 | } | 239 | } |
774 | 240 | |||
775 | 241 | Label { text: "Focused Application"; font.bold: true } | ||
776 | 242 | |||
777 | 243 | Row { | ||
778 | 244 | CheckBox { | ||
779 | 245 | id: fullscreeAppCheck | ||
780 | 246 | |||
781 | 247 | onTriggered: { | ||
782 | 248 | if (!controls.focusedSurface) return; | ||
783 | 249 | if (controls.focusedSurface.state == Mir.FullscreenState) { | ||
784 | 250 | controls.focusedSurface.state = Mir.RestoredState; | ||
785 | 251 | } else { | ||
786 | 252 | controls.focusedSurface.state = Mir.FullscreenState; | ||
787 | 253 | } | ||
788 | 254 | } | ||
789 | 255 | |||
790 | 256 | Binding { | ||
791 | 257 | target: fullscreeAppCheck | ||
792 | 258 | when: controls.focusedSurface | ||
793 | 259 | property: "checked" | ||
794 | 260 | value: { | ||
795 | 261 | if (!controls.focusedSurface) return false; | ||
796 | 262 | controls.focusedSurface.state === Mir.FullscreenState | ||
797 | 263 | } | ||
798 | 264 | } | ||
799 | 265 | } | ||
800 | 266 | Label { | ||
801 | 267 | text: "Fullscreen" | ||
802 | 268 | } | ||
803 | 269 | } | ||
804 | 270 | |||
805 | 271 | Row { | ||
806 | 272 | CheckBox { | ||
807 | 273 | id: chromeAppCheck | ||
808 | 274 | |||
809 | 275 | onTriggered: { | ||
810 | 276 | if (!controls.focusedSurface) return; | ||
811 | 277 | if (controls.focusedSurface.shellChrome == Mir.LowChrome) { | ||
812 | 278 | controls.focusedSurface.setShellChrome(Mir.NormalChrome); | ||
813 | 279 | } else { | ||
814 | 280 | controls.focusedSurface.setShellChrome(Mir.LowChrome); | ||
815 | 281 | } | ||
816 | 282 | } | ||
817 | 283 | |||
818 | 284 | Binding { | ||
819 | 285 | target: chromeAppCheck | ||
820 | 286 | when: controls.focusedSurface !== null | ||
821 | 287 | property: "checked" | ||
822 | 288 | value: { | ||
823 | 289 | if (!controls.focusedSurface) return false; | ||
824 | 290 | controls.focusedSurface.shellChrome === Mir.LowChrome | ||
825 | 291 | } | ||
826 | 292 | } | ||
827 | 293 | } | ||
828 | 294 | Label { | ||
829 | 295 | text: "Low Chrome" | ||
830 | 296 | } | ||
831 | 297 | } | ||
832 | 298 | |||
833 | 237 | } | 299 | } |
834 | 238 | } | 300 | } |
835 | 239 | } | 301 | } |
FAILED: Continuous integration, rev:2207 /unity8- jenkins. ubuntu. com/job/ lp-unity8- 1-ci/403/ /unity8- jenkins. ubuntu. com/job/ build/543/ console /unity8- jenkins. ubuntu. com/job/ build-0- fetch/566 /unity8- jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 585 /unity8- jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial/ 585 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= vivid+overlay/ 581/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial/ 581/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= vivid+overlay/ 581/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial/ 581/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= vivid+overlay/ 581/console /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial/ 581/console
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /unity8- jenkins. ubuntu. com/job/ lp-unity8- 1-ci/403/ rebuild
https:/