diff options
author | Bramastyo Harimukti <bramastyo.harimukti.santoso@pelagicore.com> | 2019-01-29 16:33:36 +0100 |
---|---|---|
committer | Bramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com> | 2019-01-31 12:04:41 +0000 |
commit | f6e8b7191736f786c8bf39636540650170d2ac6c (patch) | |
tree | de9306462fadb917cee211c83677e2ef06f964b9 | |
parent | cce4f1d200f153a407f886f00f1827c5d432b73b (diff) |
[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 <dominik.holland@pelagicore.com>
-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; } } |