From f6e8b7191736f786c8bf39636540650170d2ac6c Mon Sep 17 00:00:00 2001 From: Bramastyo Harimukti Date: Tue, 29 Jan 2019 16:33:36 +0100 Subject: [sysui] only apply the animation when incoming window is different previously, the application info's window changed signal is emitted when a new language locale is selected, therefore a random behavior sometime appears. This patch make sure that if an application is called, it will only apply the animation once. This problem occurs only in single process. Change-Id: I564b983def6b205e6a29ed23303680bca8cd8d75 Reviewed-by: Dominik Holland --- sysui/centerconsole/ApplicationFrame.qml | 31 +++++++++++++++++++------------ 1 file 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; } } -- cgit v1.2.3