on xenial help sign in
review fixes
commit963cdec43375bf205ca773a406cfce7605479efb authorNick Dedekind <nick.dedekind@canonical.com> dateTue 15 Mar 2016, 19:27 (11 years ago) parentb7a86e7
8 files changed+42−52
qml/Shell.qml+2−2 qml/Stages/AbstractStage.qml+1−1 qml/Stages/DesktopStage.qml+2−2 qml/Stages/PhoneStage.qml+5−6 qml/Stages/PhoneFullscreenPolicy.qml → qml/Stages/StagedFullscreenPolicy.qml+15−18 qml/Stages/TabletStage.qml+5−8 qml/Stages/DesktopFullscreenPolicy.qml → qml/Stages/WindowedFullscreenPolicy.qml+11−14 tests/qmltests/tst_Shell.qml+1−1
qml/Shell.qml+2−2
@@ -246,7 +246,7 @@ Item {
246246 property string usageScenario: shell.usageScenario === "phone" || greeter.hasLockedApp
247247 ? "phone"
248248 : shell.usageScenario
249− property string qmlComponent: {
249+ readonly property string qmlComponent: {
250250 if(shell.mode === "greeter") {
251251 return "Stages/ShimStage.qml"
252252 } else if (applicationsDisplayLoader.usageScenario === "phone") {
@@ -258,7 +258,7 @@ Item {
258258 }
259259 }
260260 onQmlComponentChanged: {
261− if (item) item.stageUnloaded();
261+ if (item) item.stageAboutToBeUnloaded();
262262 source = qmlComponent;
263263 }
264264
qml/Stages/AbstractStage.qml+1−1
@@ -51,7 +51,7 @@ Rectangle {
5151 | Qt.InvertedPortraitOrientation
5252 | Qt.InvertedLandscapeOrientation
5353
54− signal stageUnloaded
54+ signal stageAboutToBeUnloaded
5555
5656 // Shared code for use in stage implementations
5757 GSettings {
qml/Stages/DesktopStage.qml+2−2
@@ -501,7 +501,7 @@ AbstractStage {
501501 property bool saveStateOnDestruction: true
502502 Connections {
503503 target: root
504− onStageUnloaded: {
504+ onStageAboutToBeUnloaded: {
505505 resizeArea.saveWindowState();
506506 resizeArea.saveStateOnDestruction = false;
507507 fullscreenPolicy.active = false;
@@ -533,7 +533,7 @@ AbstractStage {
533533 onDecorationPressed: { ApplicationManager.focusApplication(model.appId) }
534534 }
535535
536− DesktopFullscreenPolicy {
536+ WindowedFullscreenPolicy {
537537 id: fullscreenPolicy
538538 active: true
539539 application: decoratedWindow.application
qml/Stages/PhoneStage.qml+5−6
@@ -630,14 +630,13 @@ AbstractStage {
630630 value: orientationChangesEnabled
631631 }
632632
633− PhoneFullscreenPolicy {
633+ StagedFullscreenPolicy {
634634 id: fullscreenPolicy
635635 application: appDelegate.application
636−
637− Connections {
638− target: root
639− onStageUnloaded: fullscreenPolicy.active = false
640− }
636+ }
637+ Connections {
638+ target: root
639+ onStageAboutToBeUnloaded: fullscreenPolicy.active = false
641640 }
642641 }
643642 }
qml/Stages/PhoneFullscreenPolicy.qml → qml/Stages/StagedFullscreenPolicy.qmlrenamed+15−18
@@ -17,36 +17,33 @@
1717import QtQuick 2.4
1818import Unity.Application 0.1
1919
20−Item {
20+QtObject {
2121 property bool active: true
2222 property QtObject application: null
2323
24− QtObject {
25− id: priv
26− property var lastSurface: application && application.session ?
27− application.session.lastSurface : null
28− onLastSurfaceChanged: {
29− if (!active || !lastSurface) return;
30− if (lastSurface.shellChrome === Mir.LowChrome) {
31− lastSurface.state = Mir.FullscreenState;
32− }
24+ readonly property var lastSurface: application && application.session ?
25+ application.session.lastSurface : null
26+ onLastSurfaceChanged: {
27+ if (!active || !lastSurface) return;
28+ if (lastSurface.shellChrome === Mir.LowChrome) {
29+ lastSurface.state = Mir.FullscreenState;
3330 }
3431 }
3532
36− Connections {
37− target: priv.lastSurface
33+ property var _connections: Connections {
34+ target: lastSurface
3835 onShellChromeChanged: {
39− if (!active || !priv.lastSurface) return;
40− if (priv.lastSurface.shellChrome === Mir.LowChrome) {
41− priv.lastSurface.state = Mir.FullscreenState;
36+ if (!active || !lastSurface) return;
37+ if (lastSurface.shellChrome === Mir.LowChrome) {
38+ lastSurface.state = Mir.FullscreenState;
4239 } else {
43− priv.lastSurface.state = Mir.RestoredState;
40+ lastSurface.state = Mir.RestoredState;
4441 }
4542 }
4643 onStateChanged: {
4744 if (!active) return;
48− if (priv.lastSurface.state === Mir.RestoredState && priv.lastSurface.shellChrome === Mir.LowChrome) {
49− priv.lastSurface.state = Mir.FullscreenState;
45+ if (lastSurface.state === Mir.RestoredState && lastSurface.shellChrome === Mir.LowChrome) {
46+ lastSurface.state = Mir.FullscreenState;
5047 }
5148 }
5249 }
qml/Stages/TabletStage.qml+5−8
@@ -688,8 +688,6 @@ AbstractStage {
688688
689689 readonly property bool wantsMainStage: model.stage == ApplicationInfoInterface.MainStage
690690
691− readonly property bool isDash: model.appId == "unity8-dash"
692−
693691 stage: model.stage
694692 fullscreen: {
695693 if (mainApp && stage === ApplicationInfoInterface.SideStage) {
@@ -949,14 +947,13 @@ AbstractStage {
949947 progress: spreadTile.progress - spreadView.positionMarker1
950948 }
951949
952− PhoneFullscreenPolicy {
950+ StagedFullscreenPolicy {
953951 id: fullscreenPolicy
954952 application: spreadTile.application
955−
956− Connections {
957− target: root
958− onStageUnloaded: fullscreenPolicy.active = false
959− }
953+ }
954+ Connections {
955+ target: root
956+ onStageAboutToBeUnloaded: fullscreenPolicy.active = false
960957 }
961958 }
962959 }
qml/Stages/DesktopFullscreenPolicy.qml → qml/Stages/WindowedFullscreenPolicy.qmlrenamed+11−14
@@ -14,27 +14,24 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.4
17+import QtQml 2.2
1818import Unity.Application 0.1
1919
20−Item {
20+QtObject {
2121 property bool active: true
2222 property QtObject application: null
2323
24− QtObject {
25− id: priv
26− property bool firstTimeSurface: true
27− property var lastSurface: application && application.session ?
24+ readonly property var lastSurface: application && application.session ?
2825 application.session.lastSurface : null
29− onLastSurfaceChanged: {
30− if (!active || !lastSurface) return;
31− if (!firstTimeSurface) return;
32− firstTimeSurface = false;
26+ property bool _firstTimeSurface: true
3327
34− if (lastSurface.state === Mir.FullscreenState &&
35− lastSurface.shellChrome === Mir.LowChrome) {
36− lastSurface.state = Mir.RestoredState;
37− }
28+ onLastSurfaceChanged: {
29+ if (!active || !lastSurface) return;
30+ if (!_firstTimeSurface) return;
31+ _firstTimeSurface = false;
32+
33+ if (lastSurface.state === Mir.FullscreenState && lastSurface.shellChrome === Mir.LowChrome) {
34+ lastSurface.state = Mir.RestoredState;
3835 }
3936 }
4037}
tests/qmltests/tst_Shell.qml+1−1
@@ -276,7 +276,7 @@ Rectangle {
276276 property: "checked"
277277 value: {
278278 if (!controls.focusedSurface) return false;
279− controls.focusedSurface.state === Mir.FullscreenState
279+ return controls.focusedSurface.state === Mir.FullscreenState
280280 }
281281 }
282282 }