@@ -277,9 +277,6 @@ Rectangle {
277277 function minimize(animated) {
278278 animationsEnabled = (animated === undefined) || animated;
279279 minimized = true;
280− if (!!animated) {
281− priv.focusNext();
282− }
283280 }
284281 function restore(animated) {
285282 animationsEnabled = (animated === undefined) || animated;
@@ -327,7 +324,16 @@ Rectangle {
327324 from: "maximized,maximizedLeft,maximizedRight,minimized,normal,"
328325 to: "maximized,maximizedLeft,maximizedRight,minimized,normal,"
329326 enabled: appDelegate.animationsEnabled
330− PropertyAnimation { target: appDelegate; properties: "x,y,opacity,width,height,scale" }
327+ SequentialAnimation {
328+ PropertyAnimation { target: appDelegate; properties: "x,y,opacity,width,height,scale" }
329+ ScriptAction {
330+ script: {
331+ if (animationsEnabled && state === "minimized" ) {
332+ priv.focusNext();
333+ }
334+ }
335+ }
336+ }
331337 },
332338 Transition {
333339 from: ""