From 17d9edbd0c7edfc53d13cf8d34d34167971f3912 Mon Sep 17 00:00:00 2001 From: Sho Date: Sun, 2 Aug 2026 16:41:43 +0900 Subject: [PATCH] fix(workspace): add 120ms scroll throttle timer and auto-close popups on workspace switch to eliminate lag --- quickshell/modules/topbar/TopLeftBar.qml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/quickshell/modules/topbar/TopLeftBar.qml b/quickshell/modules/topbar/TopLeftBar.qml index 975bf25..db1e5b4 100644 --- a/quickshell/modules/topbar/TopLeftBar.qml +++ b/quickshell/modules/topbar/TopLeftBar.qml @@ -95,12 +95,22 @@ GlassPanel { id: wsItemMouse anchors.fill: parent hoverEnabled: true - onClicked: WorkspaceService.switchTo(wsItem.wsNumber) + onClicked: { + PopupService.closeAll() + WorkspaceService.switchTo(wsItem.wsNumber) + } } } } } + // Scroll Throttle Timer (Eliminates scroll lag during rapid mouse wheel scrolling) + Timer { + id: scrollThrottleTimer + interval: 120 + repeat: false + } + // Global Mouse Wheel Scroll Area MouseArea { anchors.fill: parent @@ -108,6 +118,10 @@ GlassPanel { acceptedButtons: Qt.NoButton onWheel: (wheel) => { + if (scrollThrottleTimer.running) return; + scrollThrottleTimer.restart(); + PopupService.closeAll() + if (wheel.angleDelta.y < 0) { if (WorkspaceService.activeWorkspace < WorkspaceService.totalWorkspaces) { WorkspaceService.switchTo(WorkspaceService.activeWorkspace + 1)