@@ -269,9 +269,6 @@ Rectangle {
269269 function minimize(animated) {
270270 animationsEnabled = (animated === undefined) || animated;
271271 minimized = true;
272− if (!!animated) {
273− priv.focusNext();
274− }
275272 }
276273 function restore(animated) {
277274 animationsEnabled = (animated === undefined) || animated;
@@ -319,7 +316,16 @@ Rectangle {
319316 from: "maximized,maximizedLeft,maximizedRight,minimized,normal,"
320317 to: "maximized,maximizedLeft,maximizedRight,minimized,normal,"
321318 enabled: appDelegate.animationsEnabled
322− PropertyAnimation { target: appDelegate; properties: "x,y,opacity,width,height,scale" }
319+ SequentialAnimation {
320+ PropertyAnimation { target: appDelegate; properties: "x,y,opacity,width,height,scale" }
321+ ScriptAction {
322+ script: {
323+ if (animationsEnabled && state === "minimized" ) {
324+ priv.focusNext();
325+ }
326+ }
327+ }
328+ }
323329 },
324330 Transition {
325331 from: ""