From 6aa17ad9edc6d420f34c0a49b4a333f214b7ddfb Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 15 Jan 2017 19:27:57 +0200 Subject: [PATCH] fix #51, protect animations signaling --when a task is removed too fast then some animations were not informed that had ended. So there was an addition animation signal but no removal animation signal. This fix protects this in two different cases --the normal state also from now own uses only the animations states and no the hovered task indicator. This simplifies things a lot and probably creates also a much robust experience. --- containment/contents/ui/VisibilityManager.qml | 8 +++---- plasmoid/contents/ui/TaskDelegate.qml | 21 ++++++++++++++++++- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/containment/contents/ui/VisibilityManager.qml b/containment/contents/ui/VisibilityManager.qml index 0d2bb914f..62604a591 100644 --- a/containment/contents/ui/VisibilityManager.qml +++ b/containment/contents/ui/VisibilityManager.qml @@ -119,15 +119,13 @@ Item{ var localX = 0; var localY = 0; - normalState = ((root.nowDockHoveredIndex === -1) && (layoutsContainer.hoveredIndex === -1) - && (root.animationsNeedBothAxis === 0) && (root.animationsNeedLength === 0)) + normalState = ((root.animationsNeedBothAxis === 0) && (root.animationsNeedLength === 0)) || !windowSystem.compositingActive; // debug maskArea criteria if (debugMagager) { - console.log(root.nowDockHoveredIndex + ", " + layoutsContainer.hoveredIndex + ", " - + root.animationsNeedBothAxis + ", " + root.animationsNeedLength + ", " + root.animationsNeedThickness + - ", " + dock.visibility.isHidden); + console.log(root.animationsNeedBothAxis + ", " + root.animationsNeedLength + ", " + + root.animationsNeedThickness + ", " + dock.visibility.isHidden); if (previoiusNormalState !== normalState) { console.log("normal state changed to:" + normalState); diff --git a/plasmoid/contents/ui/TaskDelegate.qml b/plasmoid/contents/ui/TaskDelegate.qml index 35a8b0ba0..eb69cf6b2 100644 --- a/plasmoid/contents/ui/TaskDelegate.qml +++ b/plasmoid/contents/ui/TaskDelegate.qml @@ -954,6 +954,14 @@ MouseArea{ init(); start(); } + + Component.onDestruction: { + if (animationSent){ + //console.log("SAFETY REMOVAL 2: animation removing ended"); + animationSent = false; + root.signalAnimationsNeedLength(-1); + } + } } //A Timer to check how much time the task is hovered in order to check if we must @@ -1084,7 +1092,18 @@ MouseArea{ } PropertyAction { target: mainItemContainer; property: "inAnimation"; value: false } - ScriptAction{script:{root.signalAnimationsNeedLength(-1)}} + ScriptAction{ + script:{ + if (showWindowAnimation.animationSent){ + //console.log("SAFETY REMOVAL 1: animation removing ended"); + showWindowAnimation.animationSent = false; + root.signalAnimationsNeedLength(-1); + } + + root.signalAnimationsNeedLength(-1) + } + } + PropertyAction { target: mainItemContainer; property: "ListView.delayRemove"; value: false } PropertyAction { target: icList; property: "delayingRemoval"; value: false } }