diff options
-rw-r--r-- | sysui/centerconsole/ApplicationFrame.qml | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/sysui/centerconsole/ApplicationFrame.qml b/sysui/centerconsole/ApplicationFrame.qml index b3a0db0e..d78dcff2 100644 --- a/sysui/centerconsole/ApplicationFrame.qml +++ b/sysui/centerconsole/ApplicationFrame.qml @@ -54,20 +54,27 @@ Item { QtObject { id: d + property var prevWindow property var window: root.appInfo ? root.appInfo.window : null onWindowChanged: { - if (currentMaxWindow) { - currentMaxWindow.removeAnimation.start(); - currentMaxWindow = null; - } - - if (d.window) { - currentMaxWindow = maximizedWindowComponent.createObject(d, { - "parent":root, - "appInfo": root.appInfo, - }); - d.window.parent = root; - currentMaxWindow.addAnimation.start(); + if (window !== prevWindow) { + + // only apply the in and out animations when incoming window is different + // than the previous one. + if (currentMaxWindow) { + currentMaxWindow.removeAnimation.start(); + currentMaxWindow = null; + } + + if (d.window) { + currentMaxWindow = maximizedWindowComponent.createObject(d, { + "parent":root, + "appInfo": root.appInfo, + }); + d.window.parent = root; + currentMaxWindow.addAnimation.start(); + } + prevWindow = window; } } |