From 022214e411a01c780d69cb42b34f42498dd0428c Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 6 Dec 2023 16:04:13 +0000 Subject: [PATCH] Less concurrent animations Overview was trying always to animate the opening with 2 animations at the same moment: * the transition from initial to active in WindowHeapDelegate * the animation on the partialactivationfactor was always ran, partial or not this resulted in jankier animations than they could be. now base only on partialanimationfactor, so we a re sure there is one single way to trigger the effect --- .../private/qml/WindowHeapDelegate.qml | 11 +---------- src/plugins/windowview/qml/main.qml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/plugins/private/qml/WindowHeapDelegate.qml b/src/plugins/private/qml/WindowHeapDelegate.qml index 8827a3c3da..6a374be27e 100644 --- a/src/plugins/private/qml/WindowHeapDelegate.qml +++ b/src/plugins/private/qml/WindowHeapDelegate.qml @@ -81,7 +81,7 @@ Item { } component TweenBehavior : Behavior { - enabled: thumb.state !== "partial" && thumb.windowHeap.animationEnabled && thumb.animationEnabled && !thumb.activeDragHandler.active + enabled: thumb.state === "active-normal" && thumb.windowHeap.animationEnabled && thumb.animationEnabled && !thumb.activeDragHandler.active NumberAnimation { duration: thumb.windowHeap.animationDuration easing.type: Easing.OutCubic @@ -338,15 +338,6 @@ Item { properties: "x, y, width, height" easing.type: Easing.OutCubic } - }, - Transition { - to: "initial, initial-hidden, active-normal, active-hidden" - enabled: thumb.windowHeap.animationEnabled - NumberAnimation { - duration: thumb.windowHeap.animationDuration - properties: "x, y, width, height, opacity" - easing.type: Easing.OutCubic - } } ] diff --git a/src/plugins/windowview/qml/main.qml b/src/plugins/windowview/qml/main.qml index d1ec985ea9..adacb47b59 100644 --- a/src/plugins/windowview/qml/main.qml +++ b/src/plugins/windowview/qml/main.qml @@ -200,8 +200,27 @@ Item { ~KWinComponents.WindowFilterModel.CriticalNotification } delegate: WindowHeapDelegate { + id: delegate windowHeap: heap partialActivationFactor: container.organized ? 1 : 0 + Behavior on partialActivationFactor { + SequentialAnimation { + PropertyAction { + target: delegate + property: "gestureInProgress" + value: true + } + NumberAnimation { + duration: container.effect.animationDuration + easing.type: Easing.OutCubic + } + PropertyAction { + target: delegate + property: "gestureInProgress" + value: false + } + } + } opacity: 1 - downGestureProgress onDownGestureTriggered: window.closeWindow()