diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-04-24 21:24:39 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-04-25 02:00:18 -0700 |
| commit | 929eaf0d694a9f0e8aa9b436004f0d054c9e2919 (patch) | |
| tree | ba9d951fc42d70f5d5b2b9a05aa8ead4f4c5dafb /src/layout/mod.rs | |
| parent | ce3103949fe07bb656970da30c87accde83852fa (diff) | |
| download | niri-929eaf0d694a9f0e8aa9b436004f0d054c9e2919.tar.gz niri-929eaf0d694a9f0e8aa9b436004f0d054c9e2919.tar.bz2 niri-929eaf0d694a9f0e8aa9b436004f0d054c9e2919.zip | |
Pass target workspace to view offset grab
Diffstat (limited to 'src/layout/mod.rs')
| -rw-r--r-- | src/layout/mod.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index ceed2f60..9347fc73 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -3601,7 +3601,12 @@ impl<W: LayoutElement> Layout<W> { None } - pub fn view_offset_gesture_begin(&mut self, output: &Output, is_touchpad: bool) { + pub fn view_offset_gesture_begin( + &mut self, + output: &Output, + workspace_idx: Option<usize>, + is_touchpad: bool, + ) { let monitors = match &mut self.monitor_set { MonitorSet::Normal { monitors, .. } => monitors, MonitorSet::NoOutputs { .. } => unreachable!(), @@ -3610,7 +3615,9 @@ impl<W: LayoutElement> Layout<W> { for monitor in monitors { for (idx, ws) in monitor.workspaces.iter_mut().enumerate() { // Cancel the gesture on other workspaces. - if &monitor.output != output || idx != monitor.active_workspace_idx { + if &monitor.output != output + || idx != workspace_idx.unwrap_or(monitor.active_workspace_idx) + { ws.view_offset_gesture_end(None); continue; } |
