From 6d083ea49741d6e8e85d5a1d6b6bcaa837d3b5c0 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Tue, 13 May 2025 08:11:51 +0300 Subject: layout: Fix workspace swipe to same workspace forgetting previous id This manifested much more prominently in the overview. --- src/layout/monitor.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/layout/monitor.rs b/src/layout/monitor.rs index 6c2a906a..01602001 100644 --- a/src/layout/monitor.rs +++ b/src/layout/monitor.rs @@ -1820,7 +1820,9 @@ impl Monitor { velocity *= rubber_band.clamp_derivative(min, max, gesture.start_idx + current_pos); - self.previous_workspace_id = Some(self.workspaces[self.active_workspace_idx].id()); + if self.active_workspace_idx != new_idx { + self.previous_workspace_id = Some(self.workspaces[self.active_workspace_idx].id()); + } self.active_workspace_idx = new_idx; self.workspace_switch = Some(WorkspaceSwitch::Animation(Animation::new( -- cgit