From 028421c4d73df5d5573c8d178404eaa905683ec0 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 26 Aug 2021 12:03:24 +0300 Subject: [PATCH] effects/overview: Disable animations until started Once an animation starts due to property change, it cannot be easily re-targeted. This can cause undesired animation jumps if a property changes during startup (for example from 0 to its final value). With this change, the window heap's animation will be disabled until the effect starts the intro animation. --- src/effects/overview/qml/ScreenView.qml | 3 +++ src/effects/overview/qml/WindowHeap.qml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/effects/overview/qml/ScreenView.qml b/src/effects/overview/qml/ScreenView.qml index e3a0aacf19..6ec971df82 100644 --- a/src/effects/overview/qml/ScreenView.qml +++ b/src/effects/overview/qml/ScreenView.qml @@ -13,9 +13,11 @@ FocusScope { id: container focus: true + property bool animationEnabled: false property bool organized: false function start() { + container.animationEnabled = true; container.organized = true; } @@ -84,6 +86,7 @@ FocusScope { width: heapArea.width height: heapArea.height focus: true + animationEnabled: container.animationEnabled organized: container.organized model: KWinComponents.ClientFilterModel { activity: KWinComponents.Workspace.currentActivity diff --git a/src/effects/overview/qml/WindowHeap.qml b/src/effects/overview/qml/WindowHeap.qml index e26a6c0a0d..4b56241326 100644 --- a/src/effects/overview/qml/WindowHeap.qml +++ b/src/effects/overview/qml/WindowHeap.qml @@ -23,6 +23,8 @@ FocusScope { property alias model: windowsRepeater.model property int selectedIndex: -1 + property bool animationEnabled: false + required property bool organized ExpoLayout { @@ -99,6 +101,7 @@ FocusScope { ] component TweenBehavior : Behavior { + enabled: heap.animationEnabled NumberAnimation { duration: effect.animationDuration easing.type: Easing.InOutCubic