diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 29a123fa8..233b78ba7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -529,12 +529,12 @@ jobs: fail-fast: false matrix: repo: - - dgop - - dankgo +# - dgop +# - dankgo # - dank-qml-common # - dankcalendar - - danksearch - - dank-greeter +# - danksearch +# - dank-greeter steps: - name: Create GitHub App token id: app_token diff --git a/quickshell/Common/WheelInput.js b/quickshell/Common/WheelInput.js new file mode 100644 index 000000000..c8a5db02d --- /dev/null +++ b/quickshell/Common/WheelInput.js @@ -0,0 +1,29 @@ +.pragma library + +// Qt Wayland sends scroll phases only for the finger axis source; pixelDelta also comes with wheels from Qt 6.12 (qtbase d19bd66b4) +const Kind = Object.freeze({ + none: "none", + touchpad: "touchpad", + wheel: "wheel", + highResWheel: "highResWheel" +}); + +function isTouchpad(wheel) { + if (wheel.phase === Qt.NoScrollPhase) + return false; + return wheel.pixelDelta.x !== 0 || wheel.pixelDelta.y !== 0; +} + +function verticalKind(wheel) { + if (isTouchpad(wheel)) + return Kind.touchpad; + const angle = wheel.angleDelta.y; + if (angle === 0) + return Kind.none; + return angle % 120 === 0 ? Kind.wheel : Kind.highResWheel; +} + +function anyAxisDelta(wheel) { + const point = isTouchpad(wheel) ? wheel.pixelDelta : wheel.angleDelta; + return point.x || point.y; +} diff --git a/quickshell/Modules/DankBar/BarScrollArea.qml b/quickshell/Modules/DankBar/BarScrollArea.qml index 3eb44bf08..a9f8501ed 100644 --- a/quickshell/Modules/DankBar/BarScrollArea.qml +++ b/quickshell/Modules/DankBar/BarScrollArea.qml @@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound import QtQuick import qs.Common import qs.Services +import "../../Common/WheelInput.js" as WheelInput MouseArea { id: root @@ -93,16 +94,15 @@ MouseArea { const deltaY = wheel.angleDelta.y; const deltaX = wheel.angleDelta.x; - const isTouchpadY = wheel.pixelDelta && wheel.pixelDelta.y !== 0; - const isTouchpadX = wheel.pixelDelta && wheel.pixelDelta.x !== 0; + const isTouchpad = WheelInput.isTouchpad(wheel); if (CompositorService.isNiri && xBehavior !== "none" && Math.abs(deltaX) > Math.abs(deltaY)) { - accumulateX(isTouchpadX, deltaX, xBehavior); + accumulateX(isTouchpad, deltaX, xBehavior); return; } if (yBehavior === "none") return; - accumulateY(isTouchpadY, deltaY, yBehavior); + accumulateY(isTouchpad, deltaY, yBehavior); } onWheel: wheel => processWheel(wheel) diff --git a/quickshell/Modules/DankBar/Widgets/WorkspaceSwitcher.qml b/quickshell/Modules/DankBar/Widgets/WorkspaceSwitcher.qml index e12ca73b9..6ba353d01 100644 --- a/quickshell/Modules/DankBar/Widgets/WorkspaceSwitcher.qml +++ b/quickshell/Modules/DankBar/Widgets/WorkspaceSwitcher.qml @@ -8,6 +8,7 @@ import Quickshell.WindowManager import qs.Common import qs.Services import qs.Widgets +import "../../../Common/WheelInput.js" as WheelInput Item { id: root @@ -992,7 +993,7 @@ Item { return; const delta = wheel.angleDelta.y; - const isTouchpad = wheel.pixelDelta && wheel.pixelDelta.y !== 0; + const isTouchpad = WheelInput.isTouchpad(wheel); const reverse = SettingsData.reverseScrolling ? -1 : 1; if (isTouchpad) {