From 11f42978fac1194f2ad7d55d7b15094345cc22b7 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 30 Jan 2022 20:20:05 +0200 Subject: [PATCH] specify input mask when parabolic effect applied --trying to handle this way all jumpiness from parabolic effect when dock is at the bottom edge and the user moves its mouse at the top edge of the parabolized item. When the mouse slightly exits the item ParabolicMouseArea and gets a mouseEntered signal even though, it should not and immediately gets also a mouseExited signal to correct things. This happens exactly after the Paraboli.sglClearZoom() signal has been triggered. --- .../package/contents/ui/VisibilityManager.qml | 51 ++++++++++--------- .../contents/ui/applet/ParabolicArea.qml | 10 ++++ 2 files changed, 38 insertions(+), 23 deletions(-) diff --git a/containment/package/contents/ui/VisibilityManager.qml b/containment/package/contents/ui/VisibilityManager.qml index 4b88bc3de..e442753c3 100644 --- a/containment/package/contents/ui/VisibilityManager.qml +++ b/containment/package/contents/ui/VisibilityManager.qml @@ -317,18 +317,15 @@ Item{ //! Input Mask if (updateIsEnabled) { - var animated = (animations.needBothAxis.count>0); - - if (animated) { - //! clear input mask - latteView.effects.inputMask = Qt.rect(0, 0, -1, -1); - } else { - updateInputGeometry(); - } + updateInputGeometry(); } } function updateInputGeometry() { + // VisibilityManager.qml tries to workaround faulty onEntered() signals from ParabolicMouseArea + // by specifying inputThickness when ParabolicEffect is applied. (inputThickness->animated scenario) + var animated = (animations.needBothAxis.count>0); + if (!LatteCore.WindowSystem.compositingActive || latteView.behaveAsPlasmaPanel) { //! clear input mask latteView.effects.inputMask = Qt.rect(0, 0, -1, -1); @@ -339,9 +336,9 @@ Item{ if (latteView.visibility.isHidden) { inputThickness = metrics.mask.thickness.hidden; } else if (root.hasFloatingGapInputEventsDisabled) { - inputThickness = metrics.totals.thickness; + inputThickness = animated ? metrics.mask.thickness.zoomedForItems - metrics.margins.screenEdge : metrics.totals.thickness; } else { - inputThickness = metrics.mask.screenEdge + metrics.totals.thickness; + inputThickness = animated ? metrics.mask.thickness.zoomedForItems : metrics.mask.screenEdge + metrics.totals.thickness; } var subtractedScreenEdge = root.hasFloatingGapInputEventsDisabled && !latteView.visibility.isHidden ? metrics.mask.screenEdge : 0; @@ -350,29 +347,37 @@ Item{ //!use view.localGeometry for length properties if (plasmoid.location === PlasmaCore.Types.TopEdge) { - inputGeometry.x = latteView.localGeometry.x; - inputGeometry.y = subtractedScreenEdge; + if (!animated) { + inputGeometry.x = latteView.localGeometry.x; + inputGeometry.width = latteView.localGeometry.width; + } - inputGeometry.width = latteView.localGeometry.width; - inputGeometry.height = inputThickness ; + inputGeometry.y = subtractedScreenEdge; + inputGeometry.height = inputThickness; } else if (plasmoid.location === PlasmaCore.Types.BottomEdge) { - inputGeometry.x = latteView.localGeometry.x; - inputGeometry.y = root.height - inputThickness - subtractedScreenEdge; + if (!animated) { + inputGeometry.x = latteView.localGeometry.x; + inputGeometry.width = latteView.localGeometry.width; + } - inputGeometry.width = latteView.localGeometry.width; + inputGeometry.y = root.height - inputThickness - subtractedScreenEdge; inputGeometry.height = inputThickness; } else if (plasmoid.location === PlasmaCore.Types.LeftEdge) { - inputGeometry.x = subtractedScreenEdge; - inputGeometry.y = latteView.localGeometry.y; + if (!animated) { + inputGeometry.y = latteView.localGeometry.y; + inputGeometry.height = latteView.localGeometry.height; + } + inputGeometry.x = subtractedScreenEdge; inputGeometry.width = inputThickness; - inputGeometry.height = latteView.localGeometry.height; } else if (plasmoid.location === PlasmaCore.Types.RightEdge) { - inputGeometry.x = root.width - inputThickness - subtractedScreenEdge; - inputGeometry.y = latteView.localGeometry.y; + if (!animated) { + inputGeometry.y = latteView.localGeometry.y; + inputGeometry.height = latteView.localGeometry.height; + } + inputGeometry.x = root.width - inputThickness - subtractedScreenEdge; inputGeometry.width = inputThickness; - inputGeometry.height = latteView.localGeometry.height; } //set the boundaries for latteView local geometry diff --git a/containment/package/contents/ui/applet/ParabolicArea.qml b/containment/package/contents/ui/applet/ParabolicArea.qml index 888dad893..7f8b6ff21 100644 --- a/containment/package/contents/ui/applet/ParabolicArea.qml +++ b/containment/package/contents/ui/applet/ParabolicArea.qml @@ -29,6 +29,16 @@ Item { && !communicator.indexerIsSupported && appletItem.parabolic.currentParabolicItem !== _parabolicArea + // VisibilityManager.qml tries to workaround faulty onEntered() signals from this MouseArea + // by specifying inputThickness when ParabolicEffect is applied. (inputThickness->animated scenario) + // + // Such is a case is when dock is at the bottom and user moves its + // mouse at top edge of parabolized item. When mouse exits + // slightly ParabolicMouseArea this mousearea here gets a mouseEntered + // signal even though it should not and immediately gets also + // a mouseExited signal to correct things. This happens exactly + // after Paraboli.sglClearZoom() signal has been triggered. + onEntered: { appletItem.parabolic.setCurrentParabolicItem(_parabolicArea);