@@ -485,6 +485,26 @@ FocusScope {
485 ? (!model.application.isTouchApp || isExemptFromLifecycle(model.application.appId))
485 ? (!model.application.isTouchApp || isExemptFromLifecycle(model.application.appId))
489+ property var focusRequestedConnection: Connections {
490+ target: model.application
493+ // Application emits focusRequested when it has no surface (i.e. their processes died).
494+ // Find the topmost window for this application and activate it, after which the app
495+ // will be requested to be running.
497+ for (var i = 0; i < appRepeater.count; i++) {
498+ var appDelegate = appRepeater.itemAt(i);
499+ if (appDelegate.application.appId === model.application.appId) {
500+ appDelegate.activate();
505+ console.warn("Application requested te be focused but no window for it. What should we do?");