From 0bee41c9a70a75b6f09de667f5c6d55bef3e85b0 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 24 Jul 2018 18:26:17 +0300 Subject: [PATCH] delayer for tasks wheel events -- touchpads and fast wheel scrolling for tasks was creating an unpredicted effect from user point view. The solution was already tested from audio badges, applets wheel activation but hadnt got into for Tasks. BUG: 396737 FIXED-IN: 0.8.1 --- .../package/contents/ui/task/TaskDelegate.qml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/plasmoid/package/contents/ui/task/TaskDelegate.qml b/plasmoid/package/contents/ui/task/TaskDelegate.qml index b4b9d87f7..fce98432b 100644 --- a/plasmoid/package/contents/ui/task/TaskDelegate.qml +++ b/plasmoid/package/contents/ui/task/TaskDelegate.qml @@ -88,6 +88,7 @@ MouseArea{ // hoverEnabled: false //opacity : isSeparator && (hiddenSpacerLeft.neighbourSeparator || hiddenSpacerRight.neighbourSeparator) ? 0 : 1 + property bool blockWheel: false property bool buffersAreReady: false property bool delayingRemove: ListView.delayRemove property bool scalesUpdatedOnce: false @@ -863,13 +864,16 @@ MouseArea{ } onWheel: { - if (isSeparator || !root.mouseWheelActions || inWheelAction || inBouncingAnimation + if (isSeparator || !root.mouseWheelActions || blockWheel || inWheelAction || inBouncingAnimation || (latteDock && (latteDock.dockIsHidden || latteDock.inSlidingIn || latteDock.inSlidingOut))){ return; } var angle = wheel.angleDelta.y / 8; + blockWheel = true; + scrollDelayer.start(); + //positive direction if (angle > 12) { if (isLauncher || root.disableAllWindowsFunctionality) { @@ -908,6 +912,18 @@ MouseArea{ } } + //! A timer is needed in order to handle also touchpads that probably + //! send too many signals very fast. This way the signals per sec are limited. + //! The user needs to have a steady normal scroll in order to not + //! notice a annoying delay + Timer{ + id: scrollDelayer + + interval: 400 + + onTriggered: mainItemContainer.blockWheel = false; + } + ///////////////// End Of Mouse Area Events /////////////////// ///// Handlers for Signals /////