@@ -104,7 +104,7 @@ Rectangle {
104104 GlobalShortcut {
105105 id: maximizeWindowShortcut
106106 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Up
107− onTriggered: priv.focusedAppDelegate.minimized ? priv.focusedAppDelegate.restoreFromMinimized() : priv.focusedAppDelegate.maximize()
107+ onTriggered: priv.focusedAppDelegate.maximize()
108108 active: priv.focusedAppDelegate !== null
109109 }
110110
@@ -138,11 +138,6 @@ Rectangle {
138138 var index = indexOf(focusedAppId);
139139 return index >= 0 && index < appRepeater.count ? appRepeater.itemAt(index) : null
140140 }
141− onFocusedAppDelegateChanged: { // restore the window from minimization when we focus it (e.g. using spread)
142− if (focusedAppDelegate && focusedAppDelegate.minimized) {
143− focusedAppDelegate.restore();
144− }
145− }
146141
147142 function indexOf(appId) {
148143 for (var i = 0; i < ApplicationManager.count; i++) {
@@ -157,7 +152,7 @@ Rectangle {
157152 for (var i = 0; i < appRepeater.count; i++) {
158153 var appDelegate = appRepeater.itemAt(i);
159154 if (appDelegate && !appDelegate.minimized) {
160− appDelegate.minimize(false);
155+ appDelegate.minimize(false); // minimize but don't switch focus
161156 }
162157 }
163158
@@ -165,6 +160,7 @@ Rectangle {
165160 }
166161
167162 function focusNext() {
163+ ApplicationManager.unfocusCurrentApplication();
168164 for (var i = 0; i < appRepeater.count; i++) {
169165 var appDelegate = appRepeater.itemAt(i);
170166 if (appDelegate && !appDelegate.minimized) {
@@ -234,12 +230,6 @@ Rectangle {
234230 property bool animationsEnabled: true
235231 property alias title: decoratedWindow.title
236232
237− onFocusChanged: {
238− if (focus && ApplicationManager.focusedApplicationId !== appId) {
239− ApplicationManager.focusApplication(appId);
240− }
241− }
242−
243233 Binding {
244234 target: ApplicationManager.get(index)
245235 property: "requestedState"
@@ -274,7 +264,6 @@ Rectangle {
274264 animationsEnabled = (animated === undefined) || animated;
275265 minimized = true;
276266 if (!!animated) {
277− ApplicationManager.unfocusCurrentApplication();
278267 priv.focusNext();
279268 }
280269 }