@@ -293,16 +293,31 @@ AbstractStage {
294 Instantiator {
294 Instantiator {
295 model: root.applicationManager
295 model: root.applicationManager
296− delegate: Binding {
296+ delegate: QtObject {
297+ property var stateBinding: Binding {
298+ readonly property bool isDash: model.application ? model.application.appId == "unity8-dash" : false
297− target: model.application
299+ target: model.application
298− property: "requestedState"
300+ property: "requestedState"
300− // TODO: figure out some lifecycle policy, like suspending minimized apps
302+ // TODO: figure out some lifecycle policy, like suspending minimized apps
301− // if running on a tablet or something.
303+ // or something if running windowed.
302− // TODO: If the device has a dozen suspended apps because it was running
304+ // TODO: If the device has a dozen suspended apps because it was running
303− // in staged mode, when it switches to Windowed mode it will suddenly
305+ // in staged mode, when it switches to Windowed mode it will suddenly
304− // resume all those apps at once. We might want to avoid that.
306+ // resume all those apps at once. We might want to avoid that.
307+ value: root.mode === "windowed"
308+ || (isDash && root.keepDashRunning)
309+ || (!root.suspended && model.application && priv.focusedAppDelegate.appId === model.application.appId)
305− value: ApplicationInfoInterface.RequestedRunning // Always running for now
310+ ? ApplicationInfoInterface.RequestedRunning
311+ : ApplicationInfoInterface.RequestedSuspended
314+ property var lifecycleBinding: Binding {
315+ target: model.application
316+ property: "exemptFromLifecycle"
317+ value: model.application
318+ ? (!model.application.isTouchApp || isExemptFromLifecycle(model.application.appId))
@@ -608,6 +623,7 @@ AbstractStage {
608 readonly property alias resizeArea: resizeArea
623 readonly property alias resizeArea: resizeArea
609 readonly property alias focusedSurface: decoratedWindow.focusedSurface
624 readonly property alias focusedSurface: decoratedWindow.focusedSurface
626+ readonly property string appId: model.application.appId
611 readonly property bool isDash: model.application.appId == "unity8-dash"
627 readonly property bool isDash: model.application.appId == "unity8-dash"
613 function claimFocus() {
629 function claimFocus() {