on xenial help sign in
Update bindings for Application.exemptFromLifecycle
b8e8b25Daniel d'Andrada
qml/Stages/PhoneStage.qml+18−14
@@ -212,14 +212,24 @@ AbstractStage {
212
212
213 Instantiator {
213 Instantiator {
214 model: root.applicationManager
214 model: root.applicationManager
215− delegate: Binding {
215+ delegate: QtObject {
216+ property var stateBinding: Binding {
216− readonly property bool isDash: model.application ? model.application.appId == "unity8-dash" : false
217+ readonly property bool isDash: model.application ? model.application.appId == "unity8-dash" : false
217− target: model.application
218+ target: model.application
218− property: "requestedState"
219+ property: "requestedState"
219− value: (isDash && root.keepDashRunning)
220+ value: (isDash && root.keepDashRunning)
220− || (!root.suspended && model.application && priv.focusedAppId === model.application.appId)
221+ || (!root.suspended && model.application && priv.focusedAppId === model.application.appId)
221− ? ApplicationInfoInterface.RequestedRunning
222+ ? ApplicationInfoInterface.RequestedRunning
222− : ApplicationInfoInterface.RequestedSuspended
223+ : ApplicationInfoInterface.RequestedSuspended
224+ }
225+
226+ property var lifecycleBinding: Binding {
227+ target: model.application
228+ property: "exemptFromLifecycle"
229+ value: model.application
230+ ? (!model.application.isTouchApp || isExemptFromLifecycle(model.application.appId))
231+ : false
232+ }
223 }
233 }
224 }
234 }
225
235
@@ -532,12 +542,6 @@ AbstractStage {
532 }
542 }
533 }
543 }
534
544
535− Binding {
536− target: appDelegate.application
537− property: "exemptFromLifecycle"
538− value: !model.isTouchApp || isExemptFromLifecycle(model.appId)
539− }
540−
541 z: isDash && !spreadView.active ? -1 : behavioredIndex
545 z: isDash && !spreadView.active ? -1 : behavioredIndex
542
546
543 x: {
547 x: {
qml/Stages/TabletStage.qml+25−21
@@ -271,21 +271,31 @@ AbstractStage {
271
271
272 Instantiator {
272 Instantiator {
273 model: root.applicationManager
273 model: root.applicationManager
274− delegate: Binding {
274+ delegate: QtObject {
275+ property var stateBinding: Binding {
275− readonly property bool isDash: model.application ? model.application.appId == "unity8-dash" : false
276+ readonly property bool isDash: model.application ? model.application.appId == "unity8-dash" : false
276− target: model.application
277+ target: model.application
277− property: "requestedState"
278+ property: "requestedState"
278−
279+
279− // NB: the first application clause is just to ensure we never get warnings for trying to access
280+ // NB: the first application clause is just to ensure we never get warnings for trying to access
280− // members of a null variable.
281+ // members of a null variable.
281− value: model.application &&
282+ value: model.application &&
282− (
283+ (
283− (isDash && root.keepDashRunning)
284+ (isDash && root.keepDashRunning)
284− || (!root.suspended && (model.application.appId === priv.mainStageAppId
285+ || (!root.suspended && (model.application.appId === priv.mainStageAppId
285− || model.application.appId === priv.sideStageAppId))
286+ || model.application.appId === priv.sideStageAppId))
286− )
287+ )
287− ? ApplicationInfoInterface.RequestedRunning
288+ ? ApplicationInfoInterface.RequestedRunning
288− : ApplicationInfoInterface.RequestedSuspended
289+ : ApplicationInfoInterface.RequestedSuspended
290+ }
291+
292+ property var lifecycleBinding: Binding {
293+ target: model.application
294+ property: "exemptFromLifecycle"
295+ value: model.application
296+ ? (!model.application.isTouchApp || isExemptFromLifecycle(model.application.appId))
297+ : false
298+ }
289 }
299 }
290 }
300 }
291
301
@@ -787,12 +797,6 @@ AbstractStage {
787 }
797 }
788 }
798 }
789
799
790− Binding {
791− target: spreadTile.application
792− property: "exemptFromLifecycle"
793− value: !model.application.isTouchApp || isExemptFromLifecycle(model.application.appId)
794− }
795−
796 // FIXME: A regular binding doesn't update any more after closing an app.
800 // FIXME: A regular binding doesn't update any more after closing an app.
797 // Using a Binding for now.
801 // Using a Binding for now.
798 Binding {
802 Binding {