@@ -65,6 +65,11 @@ Rectangle {
6565
6666 ApplicationManager.requestFocusApplication(appId)
6767 }
68+ onApplicationRemoved: {
69+ if (priv.foregroundMaximizedAppId === appId) {
70+ priv.foregroundMaximizedAppId = "";
71+ }
72+ }
6873
6974 onFocusRequested: {
7075 var appIndex = priv.indexOf(appId);
@@ -86,6 +91,7 @@ Rectangle {
8691 var index = indexOf(focusedAppId);
8792 return index >= 0 && index < appRepeater.count ? appRepeater.itemAt(index) : null
8893 }
94+ property string foregroundMaximizedAppId: ""
8995
9096 function indexOf(appId) {
9197 for (var i = 0; i < ApplicationManager.count; i++) {
@@ -150,6 +156,18 @@ Rectangle {
150156 }
151157 }
152158
159+ readonly property bool foregroundMaximized: maximized && index == 0
160+ onForegroundMaximizedChanged: {
161+ if (foregroundMaximized) {
162+ priv.foregroundMaximizedAppId = model.appId;
163+ } else if (priv.foregroundMaximizedAppId === model.appId) {
164+ priv.foregroundMaximizedAppId = "";
165+ }
166+ }
167+
168+ visible: !minimized &&
169+ (priv.foregroundMaximizedAppId === "" || priv.foregroundMaximizedAppId === model.appId)
170+
153171 Binding {
154172 target: ApplicationManager.get(index)
155173 property: "requestedState"