@@ -22,29 +22,15 @@ import Unity.Session 0.1
2222import Utils 0.1
2323import "../Components"
2424
25−Rectangle {
25+AbstractStage {
2626 id: root
2727
28− // Controls to be set from outside
29− property int dragAreaWidth
30− property real maximizedAppTopMargin
31− property bool interactive
32− property bool spreadEnabled: true // If false, animations and right edge will be disabled
33− property real inverseProgress: 0 // This is the progress for left edge drags, in pixels.
3428 property QtObject applicationManager: ApplicationManager
3529 property bool focusFirstApp: true // If false, focused app will appear on right edge like other apps
3630 property bool altTabEnabled: true
3731 property real startScale: 1.1
3832 property real endScale: 0.7
39− property bool keepDashRunning: true
40− property bool suspended: false
41− property int shellOrientationAngle: 0
42−
43− property int shellOrientation
44− property QtObject orientations
45− property real nativeWidth
46− property real nativeHeight
47− property bool beingResized: false
33+
4834 onBeingResizedChanged: {
4935 if (beingResized) {
5036 // Brace yourselves for impact!
@@ -56,6 +42,8 @@ Rectangle {
5642 priv.reset();
5743 }
5844 }
45+
46+ // Functions to be called from outside
5947 function updateFocusedAppOrientation() {
6048 if (spreadRepeater.count > 0) {
6149 spreadRepeater.itemAt(0).matchShellOrientation();
@@ -85,16 +73,14 @@ Rectangle {
8573 }
8674 }
8775
88− // To be read from outside
89− readonly property var mainApp: applicationManager.focusedApplicationId
76+ mainApp: applicationManager.focusedApplicationId
9077 ? applicationManager.findApplication(applicationManager.focusedApplicationId)
9178 : null
9279
93− property int mainAppWindowOrientationAngle: 0
94− readonly property bool orientationChangesEnabled: priv.focusedAppOrientationChangesEnabled
95− && !priv.focusedAppDelegateIsDislocated
96− && !(priv.focusedAppDelegate && priv.focusedAppDelegate.xBehavior.running)
97− && spreadView.phase === 0
80+ orientationChangesEnabled: priv.focusedAppOrientationChangesEnabled
81+ && !priv.focusedAppDelegateIsDislocated
82+ && !(priv.focusedAppDelegate && priv.focusedAppDelegate.xBehavior.running)
83+ && spreadView.phase === 0
9884
9985 // How far left the stage has been dragged
10086 readonly property real dragProgress: spreadRepeater.count > 0 ? -spreadRepeater.itemAt(0).xTranslate : 0
@@ -106,8 +92,6 @@ Rectangle {
10692
10793 signal opened()
10894
109− color: "#111111"
110−
11195 function select(appId) {
11296 spreadView.snapTo(priv.indexOf(appId));
11397 }
@@ -438,16 +422,21 @@ Rectangle {
438422 dropShadow: spreadView.active || priv.focusedAppDelegateIsDislocated
439423 focusFirstApp: root.focusFirstApp
440424
425+ readonly property bool isDash: model.appId == "unity8-dash"
426+
427+ readonly property bool canSuspend: model.isTouchApp
428+ && !isExemptFromLifecycle(model.appId)
429+
441430 Binding {
442431 target: appDelegate.application
443432 property: "requestedState"
444− value: (isDash && root.keepDashRunning) || (!root.suspended && appDelegate.focus)
445− ? ApplicationInfoInterface.RequestedRunning
446− : ApplicationInfoInterface.RequestedSuspended
433+ value: !canSuspend
434+ || (isDash && root.keepDashRunning)
435+ || (!root.suspended && appDelegate.focus)
436+ ? ApplicationInfoInterface.RequestedRunning
437+ : ApplicationInfoInterface.RequestedSuspended
447438 }
448439
449− readonly property bool isDash: model.appId == "unity8-dash"
450−
451440 z: isDash && !spreadView.active ? -1 : behavioredIndex
452441
453442 x: {