@@ -104,7 +104,7 @@ Rectangle {
104 GlobalShortcut {
104 GlobalShortcut {
105 id: maximizeWindowShortcut
105 id: maximizeWindowShortcut
106 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Up
106 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Up
107− onTriggered: priv.focusedAppDelegate.minimized ? priv.focusedAppDelegate.restoreFromMinimized() : priv.focusedAppDelegate.maximize()
107+ onTriggered: priv.focusedAppDelegate.maximize()
108 active: priv.focusedAppDelegate !== null
108 active: priv.focusedAppDelegate !== null
@@ -138,11 +138,6 @@ Rectangle {
138 var index = indexOf(focusedAppId);
138 var index = indexOf(focusedAppId);
139 return index >= 0 && index < appRepeater.count ? appRepeater.itemAt(index) : null
139 return index >= 0 && index < appRepeater.count ? appRepeater.itemAt(index) : null
141− onFocusedAppDelegateChanged: { // restore the window from minimization when we focus it (e.g. using spread)
142− if (focusedAppDelegate && focusedAppDelegate.minimized) {
143− focusedAppDelegate.restore();
147 function indexOf(appId) {
142 function indexOf(appId) {
148 for (var i = 0; i < ApplicationManager.count; i++) {
143 for (var i = 0; i < ApplicationManager.count; i++) {
@@ -157,7 +152,7 @@ Rectangle {
157 for (var i = 0; i < appRepeater.count; i++) {
152 for (var i = 0; i < appRepeater.count; i++) {
158 var appDelegate = appRepeater.itemAt(i);
153 var appDelegate = appRepeater.itemAt(i);
159 if (appDelegate && !appDelegate.minimized) {
154 if (appDelegate && !appDelegate.minimized) {
160− appDelegate.minimize(false);
155+ appDelegate.minimize(false); // minimize but don't switch focus
@@ -165,6 +160,7 @@ Rectangle {
167 function focusNext() {
162 function focusNext() {
163+ ApplicationManager.unfocusCurrentApplication();
168 for (var i = 0; i < appRepeater.count; i++) {
164 for (var i = 0; i < appRepeater.count; i++) {
169 var appDelegate = appRepeater.itemAt(i);
165 var appDelegate = appRepeater.itemAt(i);
170 if (appDelegate && !appDelegate.minimized) {
166 if (appDelegate && !appDelegate.minimized) {
@@ -234,12 +230,6 @@ Rectangle {
234 property bool animationsEnabled: true
230 property bool animationsEnabled: true
235 property alias title: decoratedWindow.title
231 property alias title: decoratedWindow.title
238− if (focus && ApplicationManager.focusedApplicationId !== appId) {
239− ApplicationManager.focusApplication(appId);
243 Binding {
233 Binding {
244 target: ApplicationManager.get(index)
234 target: ApplicationManager.get(index)
245 property: "requestedState"
235 property: "requestedState"
@@ -274,7 +264,6 @@ Rectangle {
274 animationsEnabled = (animated === undefined) || animated;
264 animationsEnabled = (animated === undefined) || animated;
275 minimized = true;
265 minimized = true;
276 if (!!animated) {
266 if (!!animated) {
277− ApplicationManager.unfocusCurrentApplication();
278 priv.focusNext();
267 priv.focusNext();