on xenial help sign in
review fixes
963cdecNick Dedekind
qml/Shell.qml+2−2
@@ -246,7 +246,7 @@ Item {
246 property string usageScenario: shell.usageScenario === "phone" || greeter.hasLockedApp
246 property string usageScenario: shell.usageScenario === "phone" || greeter.hasLockedApp
247 ? "phone"
247 ? "phone"
248 : shell.usageScenario
248 : shell.usageScenario
249− property string qmlComponent: {
249+ readonly property string qmlComponent: {
250 if(shell.mode === "greeter") {
250 if(shell.mode === "greeter") {
251 return "Stages/ShimStage.qml"
251 return "Stages/ShimStage.qml"
252 } else if (applicationsDisplayLoader.usageScenario === "phone") {
252 } else if (applicationsDisplayLoader.usageScenario === "phone") {
@@ -258,7 +258,7 @@ Item {
258 }
258 }
259 }
259 }
260 onQmlComponentChanged: {
260 onQmlComponentChanged: {
261− if (item) item.stageUnloaded();
261+ if (item) item.stageAboutToBeUnloaded();
262 source = qmlComponent;
262 source = qmlComponent;
263 }
263 }
264
264
qml/Stages/AbstractStage.qml+1−1
@@ -51,7 +51,7 @@ Rectangle {
51 | Qt.InvertedPortraitOrientation
51 | Qt.InvertedPortraitOrientation
52 | Qt.InvertedLandscapeOrientation
52 | Qt.InvertedLandscapeOrientation
53
53
54− signal stageUnloaded
54+ signal stageAboutToBeUnloaded
55
55
56 // Shared code for use in stage implementations
56 // Shared code for use in stage implementations
57 GSettings {
57 GSettings {
qml/Stages/DesktopStage.qml+2−2
@@ -501,7 +501,7 @@ AbstractStage {
501 property bool saveStateOnDestruction: true
501 property bool saveStateOnDestruction: true
502 Connections {
502 Connections {
503 target: root
503 target: root
504− onStageUnloaded: {
504+ onStageAboutToBeUnloaded: {
505 resizeArea.saveWindowState();
505 resizeArea.saveWindowState();
506 resizeArea.saveStateOnDestruction = false;
506 resizeArea.saveStateOnDestruction = false;
507 fullscreenPolicy.active = false;
507 fullscreenPolicy.active = false;
@@ -533,7 +533,7 @@ AbstractStage {
533 onDecorationPressed: { ApplicationManager.focusApplication(model.appId) }
533 onDecorationPressed: { ApplicationManager.focusApplication(model.appId) }
534 }
534 }
535
535
536− DesktopFullscreenPolicy {
536+ WindowedFullscreenPolicy {
537 id: fullscreenPolicy
537 id: fullscreenPolicy
538 active: true
538 active: true
539 application: decoratedWindow.application
539 application: decoratedWindow.application
qml/Stages/PhoneStage.qml+5−6
@@ -630,14 +630,13 @@ AbstractStage {
630 value: orientationChangesEnabled
630 value: orientationChangesEnabled
631 }
631 }
632
632
633− PhoneFullscreenPolicy {
633+ StagedFullscreenPolicy {
634 id: fullscreenPolicy
634 id: fullscreenPolicy
635 application: appDelegate.application
635 application: appDelegate.application
636−
636+ }
637− Connections {
637+ Connections {
638− target: root
638+ target: root
639− onStageUnloaded: fullscreenPolicy.active = false
639+ onStageAboutToBeUnloaded: fullscreenPolicy.active = false
640− }
641 }
640 }
642 }
641 }
643 }
642 }
qml/Stages/PhoneFullscreenPolicy.qml → qml/Stages/StagedFullscreenPolicy.qmlrenamed+15−18
@@ -17,36 +17,33 @@
17import QtQuick 2.4
17import QtQuick 2.4
18import Unity.Application 0.1
18import Unity.Application 0.1
19
19
20−Item {
20+QtObject {
21 property bool active: true
21 property bool active: true
22 property QtObject application: null
22 property QtObject application: null
23
23
24− QtObject {
25− id: priv
26− property var lastSurface: application && application.session ?
24+ readonly property var lastSurface: application && application.session ?
27− application.session.lastSurface : null
25+ application.session.lastSurface : null
28− onLastSurfaceChanged: {
26+ onLastSurfaceChanged: {
29− if (!active || !lastSurface) return;
27+ if (!active || !lastSurface) return;
30− if (lastSurface.shellChrome === Mir.LowChrome) {
28+ if (lastSurface.shellChrome === Mir.LowChrome) {
31− lastSurface.state = Mir.FullscreenState;
29+ lastSurface.state = Mir.FullscreenState;
32− }
33 }
30 }
34 }
31 }
35
32
36− Connections {
33+ property var _connections: Connections {
37− target: priv.lastSurface
34+ target: lastSurface
38 onShellChromeChanged: {
35 onShellChromeChanged: {
39− if (!active || !priv.lastSurface) return;
36+ if (!active || !lastSurface) return;
40− if (priv.lastSurface.shellChrome === Mir.LowChrome) {
37+ if (lastSurface.shellChrome === Mir.LowChrome) {
41− priv.lastSurface.state = Mir.FullscreenState;
38+ lastSurface.state = Mir.FullscreenState;
42 } else {
39 } else {
43− priv.lastSurface.state = Mir.RestoredState;
40+ lastSurface.state = Mir.RestoredState;
44 }
41 }
45 }
42 }
46 onStateChanged: {
43 onStateChanged: {
47 if (!active) return;
44 if (!active) return;
48− if (priv.lastSurface.state === Mir.RestoredState && priv.lastSurface.shellChrome === Mir.LowChrome) {
45+ if (lastSurface.state === Mir.RestoredState && lastSurface.shellChrome === Mir.LowChrome) {
49− priv.lastSurface.state = Mir.FullscreenState;
46+ lastSurface.state = Mir.FullscreenState;
50 }
47 }
51 }
48 }
52 }
49 }
qml/Stages/TabletStage.qml+5−8
@@ -688,8 +688,6 @@ AbstractStage {
688
688
689 readonly property bool wantsMainStage: model.stage == ApplicationInfoInterface.MainStage
689 readonly property bool wantsMainStage: model.stage == ApplicationInfoInterface.MainStage
690
690
691− readonly property bool isDash: model.appId == "unity8-dash"
692−
693 stage: model.stage
691 stage: model.stage
694 fullscreen: {
692 fullscreen: {
695 if (mainApp && stage === ApplicationInfoInterface.SideStage) {
693 if (mainApp && stage === ApplicationInfoInterface.SideStage) {
@@ -949,14 +947,13 @@ AbstractStage {
949 progress: spreadTile.progress - spreadView.positionMarker1
947 progress: spreadTile.progress - spreadView.positionMarker1
950 }
948 }
951
949
952− PhoneFullscreenPolicy {
950+ StagedFullscreenPolicy {
953 id: fullscreenPolicy
951 id: fullscreenPolicy
954 application: spreadTile.application
952 application: spreadTile.application
955−
953+ }
956− Connections {
954+ Connections {
957− target: root
955+ target: root
958− onStageUnloaded: fullscreenPolicy.active = false
956+ onStageAboutToBeUnloaded: fullscreenPolicy.active = false
959− }
960 }
957 }
961 }
958 }
962 }
959 }
qml/Stages/DesktopFullscreenPolicy.qml → qml/Stages/WindowedFullscreenPolicy.qmlrenamed+11−14
@@ -14,27 +14,24 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
15 */
16
16
17−import QtQuick 2.4
17+import QtQml 2.2
18import Unity.Application 0.1
18import Unity.Application 0.1
19
19
20−Item {
20+QtObject {
21 property bool active: true
21 property bool active: true
22 property QtObject application: null
22 property QtObject application: null
23
23
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 ?
28 application.session.lastSurface : null
25 application.session.lastSurface : null
29− onLastSurfaceChanged: {
26+ property bool _firstTimeSurface: true
30− if (!active || !lastSurface) return;
31− if (!firstTimeSurface) return;
32− firstTimeSurface = false;
33
27
28+ onLastSurfaceChanged: {
29+ if (!active || !lastSurface) return;
30+ if (!_firstTimeSurface) return;
31+ _firstTimeSurface = false;
32+
34− if (lastSurface.state === Mir.FullscreenState &&
33+ if (lastSurface.state === Mir.FullscreenState && lastSurface.shellChrome === Mir.LowChrome) {
35− lastSurface.shellChrome === Mir.LowChrome) {
36− lastSurface.state = Mir.RestoredState;
34+ lastSurface.state = Mir.RestoredState;
37− }
38 }
35 }
39 }
36 }
40}
37}
tests/qmltests/tst_Shell.qml+1−1
@@ -276,7 +276,7 @@ Rectangle {
276 property: "checked"
276 property: "checked"
277 value: {
277 value: {
278 if (!controls.focusedSurface) return false;
278 if (!controls.focusedSurface) return false;
279− controls.focusedSurface.state === Mir.FullscreenState
279+ return controls.focusedSurface.state === Mir.FullscreenState
280 }
280 }
281 }
281 }
282 }
282 }