@@ -485,6 +485,26 @@ FocusScope {
485485 ? (!model.application.isTouchApp || isExemptFromLifecycle(model.application.appId))
486486 : false
487487 }
488+
489+ property var focusRequestedConnection: Connections {
490+ target: model.application
491+
492+ onFocusRequested: {
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.
496+
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();
501+ return;
502+ }
503+ }
504+
505+ console.warn("Application requested te be focused but no window for it. What should we do?");
506+ }
507+ }
488508 }
489509 }
490510