From c5f777dc15aab7c3641897398e0ef66e7a4c093a Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Mon, 22 Sep 2025 15:20:24 -0700 Subject: [PATCH] Adjust speed of pointer scrolling --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index a14cb31..17b7edc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -53,6 +53,9 @@ mod utils; mod widgets; use dnd::{DragSurface, DragToplevel, DragWorkspace, DropTarget}; +// Number of scroll pixels before changing workspace +const SCROLL_PIXELS: f32 = 24.0; + #[derive(Clone, Debug, Default, PartialEq, CosmicConfigEntry)] struct CosmicWorkspacesConfig { show_workspace_number: bool, @@ -688,10 +691,10 @@ impl Application for App { y = -y; let scroll = previous_scroll + y; - if scroll <= -4. { + if scroll <= -SCROLL_PIXELS { self.scroll = None; ScrollDirection::Prev - } else if scroll >= 4. { + } else if scroll >= SCROLL_PIXELS { self.scroll = None; ScrollDirection::Next } else {