@@ -22,29 +22,15 @@ import Unity.Session 0.1
22import Utils 0.1
22import Utils 0.1
23import "../Components"
23import "../Components"
25−Rectangle {
25+AbstractStage {
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.
34 property QtObject applicationManager: ApplicationManager
28 property QtObject applicationManager: ApplicationManager
35 property bool focusFirstApp: true // If false, focused app will appear on right edge like other apps
29 property bool focusFirstApp: true // If false, focused app will appear on right edge like other apps
36 property bool altTabEnabled: true
30 property bool altTabEnabled: true
37 property real startScale: 1.1
31 property real startScale: 1.1
38 property real endScale: 0.7
32 property real endScale: 0.7
39− property bool keepDashRunning: true
33+
40− property bool suspended: false
41− property int shellOrientationAngle: 0
43− property int shellOrientation
44− property QtObject orientations
45− property real nativeWidth
46− property real nativeHeight
47− property bool beingResized: false
48 onBeingResizedChanged: {
34 onBeingResizedChanged: {
49 if (beingResized) {
35 if (beingResized) {
50 // Brace yourselves for impact!
36 // Brace yourselves for impact!
@@ -56,6 +42,8 @@ Rectangle {
56 priv.reset();
42 priv.reset();
46+ // Functions to be called from outside
59 function updateFocusedAppOrientation() {
47 function updateFocusedAppOrientation() {
60 if (spreadRepeater.count > 0) {
48 if (spreadRepeater.count > 0) {
61 spreadRepeater.itemAt(0).matchShellOrientation();
49 spreadRepeater.itemAt(0).matchShellOrientation();
@@ -85,16 +73,14 @@ Rectangle {
88− // To be read from outside
89− readonly property var mainApp: applicationManager.focusedApplicationId
76+ mainApp: applicationManager.focusedApplicationId
90 ? applicationManager.findApplication(applicationManager.focusedApplicationId)
77 ? applicationManager.findApplication(applicationManager.focusedApplicationId)
93− property int mainAppWindowOrientationAngle: 0
94− readonly property bool orientationChangesEnabled: priv.focusedAppOrientationChangesEnabled
80+ orientationChangesEnabled: priv.focusedAppOrientationChangesEnabled
95− && !priv.focusedAppDelegateIsDislocated
81+ && !priv.focusedAppDelegateIsDislocated
96− && !(priv.focusedAppDelegate && priv.focusedAppDelegate.xBehavior.running)
82+ && !(priv.focusedAppDelegate && priv.focusedAppDelegate.xBehavior.running)
97− && spreadView.phase === 0
83+ && spreadView.phase === 0
99 // How far left the stage has been dragged
85 // How far left the stage has been dragged
100 readonly property real dragProgress: spreadRepeater.count > 0 ? -spreadRepeater.itemAt(0).xTranslate : 0
86 readonly property real dragProgress: spreadRepeater.count > 0 ? -spreadRepeater.itemAt(0).xTranslate : 0
@@ -106,8 +92,6 @@ Rectangle {
107 signal opened()
93 signal opened()
111 function select(appId) {
95 function select(appId) {
112 spreadView.snapTo(priv.indexOf(appId));
96 spreadView.snapTo(priv.indexOf(appId));
@@ -438,16 +422,21 @@ Rectangle {
438 dropShadow: spreadView.active || priv.focusedAppDelegateIsDislocated
422 dropShadow: spreadView.active || priv.focusedAppDelegateIsDislocated
439 focusFirstApp: root.focusFirstApp
423 focusFirstApp: root.focusFirstApp
425+ readonly property bool isDash: model.appId == "unity8-dash"
427+ readonly property bool canSuspend: model.isTouchApp
428+ && !isExemptFromLifecycle(model.appId)
441 Binding {
430 Binding {
442 target: appDelegate.application
431 target: appDelegate.application
443 property: "requestedState"
432 property: "requestedState"
434+ || (isDash && root.keepDashRunning)
444− value: (isDash && root.keepDashRunning) || (!root.suspended && appDelegate.focus)
435+ || (!root.suspended && appDelegate.focus)
445− ? ApplicationInfoInterface.RequestedRunning
436+ ? ApplicationInfoInterface.RequestedRunning
446− : ApplicationInfoInterface.RequestedSuspended
437+ : ApplicationInfoInterface.RequestedSuspended
449− readonly property bool isDash: model.appId == "unity8-dash"
451 z: isDash && !spreadView.active ? -1 : behavioredIndex
440 z: isDash && !spreadView.active ? -1 : behavioredIndex