@@ -25,26 +25,11 @@ import "../Components"
25AbstractStage {
25AbstractStage {
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
40− property bool suspended: false
41− property int shellOrientationAngle: 0
42− property int shellOrientation
43− property int shellPrimaryOrientation
44− property int nativeOrientation
45− property real nativeWidth
46− property real nativeHeight
47− property bool beingResized: false
48 onBeingResizedChanged: {
33 onBeingResizedChanged: {
49 if (beingResized) {
34 if (beingResized) {
50 // Brace yourselves for impact!
35 // Brace yourselves for impact!
@@ -56,6 +41,8 @@ AbstractStage {
56 priv.reset();
41 priv.reset();
45+ // Functions to be called from outside
59 function updateFocusedAppOrientation() {
46 function updateFocusedAppOrientation() {
60 if (spreadRepeater.count > 0) {
47 if (spreadRepeater.count > 0) {
61 spreadRepeater.itemAt(0).matchShellOrientation();
48 spreadRepeater.itemAt(0).matchShellOrientation();
@@ -85,16 +72,14 @@ AbstractStage {
88− // To be read from outside
89− readonly property var mainApp: applicationManager.focusedApplicationId
75+ mainApp: applicationManager.focusedApplicationId
90 ? applicationManager.findApplication(applicationManager.focusedApplicationId)
76 ? applicationManager.findApplication(applicationManager.focusedApplicationId)
93− property int mainAppWindowOrientationAngle: 0
94− readonly property bool orientationChangesEnabled: priv.focusedAppOrientationChangesEnabled
79+ orientationChangesEnabled: priv.focusedAppOrientationChangesEnabled
95− && !priv.focusedAppDelegateIsDislocated
80+ && !priv.focusedAppDelegateIsDislocated
96− && !(priv.focusedAppDelegate && priv.focusedAppDelegate.xBehavior.running)
81+ && !(priv.focusedAppDelegate && priv.focusedAppDelegate.xBehavior.running)
97− && spreadView.phase === 0
82+ && spreadView.phase === 0
99 // How far left the stage has been dragged
84 // How far left the stage has been dragged
100 readonly property real dragProgress: spreadRepeater.count > 0 ? -spreadRepeater.itemAt(0).xTranslate : 0
85 readonly property real dragProgress: spreadRepeater.count > 0 ? -spreadRepeater.itemAt(0).xTranslate : 0
@@ -106,8 +91,6 @@ AbstractStage {
107 signal opened()
92 signal opened()
111 function select(appId) {
94 function select(appId) {
112 spreadView.snapTo(priv.indexOf(appId));
95 spreadView.snapTo(priv.indexOf(appId));
@@ -438,19 +421,21 @@ AbstractStage {
438 dropShadow: spreadView.active || priv.focusedAppDelegateIsDislocated
421 dropShadow: spreadView.active || priv.focusedAppDelegateIsDislocated
439 focusFirstApp: root.focusFirstApp
422 focusFirstApp: root.focusFirstApp
424+ readonly property bool isDash: model.appId == "unity8-dash"
426+ readonly property bool canSuspend: model.isTouchApp
427+ && !isExemptFromLifecycle(model.appId)
441 Binding {
429 Binding {
442 target: appDelegate.application
430 target: appDelegate.application
443 property: "requestedState"
431 property: "requestedState"
444− value: !model.isTouchApp
432+ value: !canSuspend
445− || isExemptFromLifecycle(model.appId)
446 || (isDash && root.keepDashRunning)
433 || (isDash && root.keepDashRunning)
447 || (!root.suspended && appDelegate.focus)
434 || (!root.suspended && appDelegate.focus)
448 ? ApplicationInfoInterface.RequestedRunning
435 ? ApplicationInfoInterface.RequestedRunning
449 : ApplicationInfoInterface.RequestedSuspended
436 : ApplicationInfoInterface.RequestedSuspended
452− readonly property bool isDash: model.appId == "unity8-dash"
454 z: isDash && !spreadView.active ? -1 : behavioredIndex
439 z: isDash && !spreadView.active ? -1 : behavioredIndex