@@ -34,7 +34,7 @@ import "Launcher"
34import "Panel"
34import "Panel"
35import "Components"
35import "Components"
36import "Notifications"
36import "Notifications"
37−import "Stages"
37+import "Stage"
38import "Tutorial"
38import "Tutorial"
39import "Wizard"
39import "Wizard"
40import Unity.Notifications 1.0 as NotificationBackend
40import Unity.Notifications 1.0 as NotificationBackend
@@ -62,19 +62,18 @@ StyledItem {
62 property string mode: "full-greeter"
62 property string mode: "full-greeter"
63 property alias oskEnabled: inputMethod.enabled
63 property alias oskEnabled: inputMethod.enabled
64 function updateFocusedAppOrientation() {
64 function updateFocusedAppOrientation() {
65− applicationsDisplayLoader.item.updateFocusedAppOrientation();
65+ stage.updateFocusedAppOrientation();
67 function updateFocusedAppOrientationAnimated() {
67 function updateFocusedAppOrientationAnimated() {
68− applicationsDisplayLoader.item.updateFocusedAppOrientationAnimated();
68+ stage.updateFocusedAppOrientationAnimated();
70 property bool hasMouse: false
70 property bool hasMouse: false
72 // to be read from outside
72 // to be read from outside
73− readonly property int mainAppWindowOrientationAngle:
73+ readonly property int mainAppWindowOrientationAngle: stage.mainAppWindowOrientationAngle
74− applicationsDisplayLoader.item ? applicationsDisplayLoader.item.mainAppWindowOrientationAngle : 0
76 readonly property bool orientationChangesEnabled: panel.indicators.fullyClosed
75 readonly property bool orientationChangesEnabled: panel.indicators.fullyClosed
77− && (applicationsDisplayLoader.item && applicationsDisplayLoader.item.orientationChangesEnabled)
76+ && stage.orientationChangesEnabled
78 && (!greeter || !greeter.animating)
77 && (!greeter || !greeter.animating)
80 readonly property bool showingGreeter: greeter && greeter.shown
79 readonly property bool showingGreeter: greeter && greeter.shown
@@ -88,19 +87,13 @@ StyledItem {
88 return Qt.PrimaryOrientation;
87 return Qt.PrimaryOrientation;
89 } else if (greeter && greeter.shown) {
88 } else if (greeter && greeter.shown) {
90 return Qt.PrimaryOrientation;
89 return Qt.PrimaryOrientation;
91− } else if (applicationsDisplayLoader.item) {
92− return shell.orientations.map(applicationsDisplayLoader.item.supportedOrientations);
94− // we just don't care
91+ return shell.orientations.map(stage.supportedOrientations);
95− return Qt.PortraitOrientation
96− | Qt.LandscapeOrientation
97− | Qt.InvertedPortraitOrientation
98− | Qt.InvertedLandscapeOrientation;
102− readonly property var mainApp:
95+ readonly property var mainApp: stage.mainApp
103− applicationsDisplayLoader.item ? applicationsDisplayLoader.item.mainApp : null
96+
104 onMainAppChanged: {
97 onMainAppChanged: {
105 if (mainApp) {
98 if (mainApp) {
106 _onMainAppChanged(mainApp.appId);
99 _onMainAppChanged(mainApp.appId);
@@ -241,157 +234,53 @@ StyledItem {
241 applicationsModel: ApplicationManager
234 applicationsModel: ApplicationManager
244− Loader {
237+ Stage {
245− id: applicationsDisplayLoader
238+ id: stage
246− objectName: "applicationsDisplayLoader"
239+ objectName: "stage"
247 anchors.fill: parent
240 anchors.fill: parent
249− // When we have a locked app, we only want to show that one app.
243+ dragAreaWidth: shell.edgeSize
250− // FIXME: do this in a less traumatic way. We currently only allow
244+ background: wallpaperResolver.background
251− // locked apps in phone mode (see FIXME in Lockscreen component in
252− // this same file). When that changes, we need to do something
253− // nicer here. But this code is currently just to prevent a
254− // theoretical attack where user enters lockedApp mode, then makes
255− // the screen larger (maybe connects to monitor) and tries to enter
258− property string usageScenario: shell.usageScenario === "phone" || greeter.hasLockedApp
246+ applicationManager: ApplicationManager
259− ? "phone"
247+ topLevelSurfaceList: topLevelSurfaceList
260− : shell.usageScenario
262− source: "Stages/DesktopStage.qml"
263− readonly property string qmlComponent: {
264− if (shell.mode === "greeter") {
265− return "Stages/AbstractStage.qml"
266− } else if (applicationsDisplayLoader.usageScenario === "phone") {
267− return "Stages/PhoneStage.qml";
268− } else if (applicationsDisplayLoader.usageScenario === "tablet") {
269− return "Stages/TabletStage.qml";
271− return "Stages/DesktopStage.qml";
249+ property string usageScenario: shell.usageScenario === "phone" || greeter.hasLockedApp
251+ : shell.usageScenario
253+ mode: usageScenario == "phone" ? "staged"
254+ : usageScenario == "tablet" ? "stagedWithSideStage"
257+ shellOrientation: shell.orientation
258+ shellOrientationAngle: shell.orientationAngle
259+ orientations: shell.orientations
260+ nativeWidth: shell.nativeWidth
261+ nativeHeight: shell.nativeHeight
262+ // TODO: Is this still needed? Didn't come across it. Needs checking before merging
263+ beingResized: shell.beingResized
265+ // TODO: Is this still needed? Didn't come across it. Needs checking before merging
266+ // Not just using panel.panelHeight as that changes depending on the focused app.
267+ maximizedAppTopMargin: panel.indicators.minimizedPanelHeight
275− property bool interactive: (!greeter || !greeter.shown)
269+ interactive: (!greeter || !greeter.shown)
276 && panel.indicators.fullyClosed
270 && panel.indicators.fullyClosed
277 && launcher.progress == 0
271 && launcher.progress == 0
278 && !notifications.useModal
272 && !notifications.useModal
280− onInteractiveChanged: { if (interactive) { focus = true; } }
274+ // TODO: This is not implemented yet in the new stage...
275+ spreadEnabled: tutorial.spreadEnabled && (!greeter || (!greeter.hasLockedApp && !greeter.shown))
276+ keepDashRunning: launcher.shown || launcher.dashSwipe
277+ suspended: greeter.shown
278+ leftMargin: shell.usageScenario == "desktop" && !settings.autohideLauncher ? launcher.panelWidth: 0
282− Binding {
280+ // TODO: this is not implemented yet in the new stage...
283− target: applicationsDisplayLoader.item
285− value: applicationsDisplayLoader.usageScenario == "phone" ? "staged"
286− : applicationsDisplayLoader.usageScenario == "tablet" ? "stagedWithSideStage"
290− target: applicationsDisplayLoader.item
295− target: applicationsDisplayLoader.item
296− property: "objectName"
300− target: applicationsDisplayLoader.item
301− property: "dragAreaWidth"
302− value: shell.edgeSize
305− target: applicationsDisplayLoader.item
306− property: "maximizedAppTopMargin"
307− // Not just using panel.panelHeight as that changes depending on the focused app.
308− value: panel.indicators.minimizedPanelHeight
311− target: applicationsDisplayLoader.item
312− property: "interactive"
313− value: applicationsDisplayLoader.interactive
316− target: applicationsDisplayLoader.item
317− property: "spreadEnabled"
318− value: tutorial.spreadEnabled && (!greeter || (!greeter.hasLockedApp && !greeter.shown))
321− target: applicationsDisplayLoader.item
322− property: "inverseProgress"
323− value: !greeter || greeter.locked || !tutorial.launcherLongSwipeEnabled ? 0 : launcher.progress
281+ inverseProgress: !greeter || greeter.locked || !tutorial.launcherLongSwipeEnabled ? 0 : launcher.progress
326− target: applicationsDisplayLoader.item
327− property: "shellOrientationAngle"
328− value: shell.orientationAngle
331− target: applicationsDisplayLoader.item
332− property: "shellOrientation"
333− value: shell.orientation
336− target: applicationsDisplayLoader.item
337− property: "orientations"
338− value: shell.orientations
341− target: applicationsDisplayLoader.item
342− property: "background"
343− value: wallpaperResolver.background
346− target: applicationsDisplayLoader.item
347− property: "nativeWidth"
348− value: shell.nativeWidth
351− target: applicationsDisplayLoader.item
352− property: "nativeHeight"
353− value: shell.nativeHeight
356− target: applicationsDisplayLoader.item
357− property: "beingResized"
358− value: shell.beingResized
361− target: applicationsDisplayLoader.item
362− property: "keepDashRunning"
363− value: launcher.shown || launcher.dashSwipe
366− target: applicationsDisplayLoader.item
367− property: "suspended"
368− value: greeter.shown
371− target: applicationsDisplayLoader.item
372− property: "altTabPressed"
373− value: physicalKeysMapper.altTabPressed
282+ altTabPressed: physicalKeysMapper.altTabPressed
376− target: applicationsDisplayLoader.item
377− property: "leftMargin"
378− value: shell.usageScenario == "desktop" && !settings.autohideLauncher ? launcher.panelWidth: 0
381− target: applicationsDisplayLoader.item
382− property: "applicationManager"
383− value: ApplicationManager
386− target: applicationsDisplayLoader.item
387− property: "topLevelSurfaceList"
388− value: topLevelSurfaceList
391− target: applicationsDisplayLoader.item
392− property: "oskEnabled"
393− value: shell.oskEnabled
283+ oskEnabled: shell.oskEnabled
@@ -610,7 +499,7 @@ StyledItem {
611 onFocusChanged: {
500 onFocusChanged: {
612 if (!focus) {
501 if (!focus) {
613− applicationsDisplayLoader.focus = true;
502+ shell.focus = true;
@@ -671,7 +560,7 @@ StyledItem {
671 lastInputTimestamp: inputFilter.lastInputTimestamp
560 lastInputTimestamp: inputFilter.lastInputTimestamp
672 launcher: launcher
561 launcher: launcher
673 panel: panel
562 panel: panel
674− stage: applicationsDisplayLoader.item
563+ stage: stage
@@ -755,7 +644,7 @@ StyledItem {
755 z: dialogs.z + 10
644 z: dialogs.z + 10
756 GlobalShortcut { shortcut: Qt.Key_Print; onTriggered: itemGrabber.capture(shell) }
645 GlobalShortcut { shortcut: Qt.Key_Print; onTriggered: itemGrabber.capture(shell) }
757 Connections {
646 Connections {
758− target: applicationsDisplayLoader.item
647+ target: stage
759 ignoreUnknownSignals: true
648 ignoreUnknownSignals: true
760 onItemSnapshotRequested: itemGrabber.capture(item)
649 onItemSnapshotRequested: itemGrabber.capture(item)
@@ -783,9 +672,8 @@ StyledItem {
785 onPushedRightBoundary: {
674 onPushedRightBoundary: {
786− if (buttons === Qt.NoButton && applicationsDisplayLoader.item
675+ if (buttons === Qt.NoButton) {
787− && applicationsDisplayLoader.item.pushRightEdge) {
788− applicationsDisplayLoader.item.pushRightEdge(amount);
676+ stage.pushRightEdge(amount);