diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-04-20 12:36:54 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-04-25 02:00:18 -0700 |
| commit | 59a42249a4da4bda44fa08a2e6a460ac1bd2000f (patch) | |
| tree | 38032bc743852a156f69fc5cb5c3e6eabb32cb6f /src/layout/mod.rs | |
| parent | 74b016202b1989f400f536d3837c8e1259c42c33 (diff) | |
| download | niri-59a42249a4da4bda44fa08a2e6a460ac1bd2000f.tar.gz niri-59a42249a4da4bda44fa08a2e6a460ac1bd2000f.tar.bz2 niri-59a42249a4da4bda44fa08a2e6a460ac1bd2000f.zip | |
Remove cancellation from swipe gestures
It only worked for workspace switch, and even there it was more confusing than
helpful.
Diffstat (limited to 'src/layout/mod.rs')
| -rw-r--r-- | src/layout/mod.rs | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 5ade9d01..6c2ba2ae 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -3534,7 +3534,7 @@ impl<W: LayoutElement> Layout<W> { for monitor in monitors { // Cancel the gesture on other outputs. if &monitor.output != output { - monitor.workspace_switch_gesture_end(true, None); + monitor.workspace_switch_gesture_end(None); continue; } @@ -3568,18 +3568,14 @@ impl<W: LayoutElement> Layout<W> { None } - pub fn workspace_switch_gesture_end( - &mut self, - cancelled: bool, - is_touchpad: Option<bool>, - ) -> Option<Output> { + pub fn workspace_switch_gesture_end(&mut self, is_touchpad: Option<bool>) -> Option<Output> { let monitors = match &mut self.monitor_set { MonitorSet::Normal { monitors, .. } => monitors, MonitorSet::NoOutputs { .. } => return None, }; for monitor in monitors { - if monitor.workspace_switch_gesture_end(cancelled, is_touchpad) { + if monitor.workspace_switch_gesture_end(is_touchpad) { return Some(monitor.output.clone()); } } @@ -3597,7 +3593,7 @@ impl<W: LayoutElement> Layout<W> { for (idx, ws) in monitor.workspaces.iter_mut().enumerate() { // Cancel the gesture on other workspaces. if &monitor.output != output || idx != monitor.active_workspace_idx { - ws.view_offset_gesture_end(true, None); + ws.view_offset_gesture_end(None); continue; } @@ -3634,11 +3630,7 @@ impl<W: LayoutElement> Layout<W> { None } - pub fn view_offset_gesture_end( - &mut self, - cancelled: bool, - is_touchpad: Option<bool>, - ) -> Option<Output> { + pub fn view_offset_gesture_end(&mut self, is_touchpad: Option<bool>) -> Option<Output> { let monitors = match &mut self.monitor_set { MonitorSet::Normal { monitors, .. } => monitors, MonitorSet::NoOutputs { .. } => return None, @@ -3646,7 +3638,7 @@ impl<W: LayoutElement> Layout<W> { for monitor in monitors { for ws in &mut monitor.workspaces { - if ws.view_offset_gesture_end(cancelled, is_touchpad) { + if ws.view_offset_gesture_end(is_touchpad) { return Some(monitor.output.clone()); } } @@ -4560,7 +4552,7 @@ impl<W: LayoutElement> Layout<W> { } else { // Cancel the view offset gesture after workspace switches, moves, etc. if ws_idx != mon.active_workspace_idx { - ws.view_offset_gesture_end(false, None); + ws.view_offset_gesture_end(None); } } } @@ -4569,7 +4561,7 @@ impl<W: LayoutElement> Layout<W> { MonitorSet::NoOutputs { workspaces, .. } => { for ws in workspaces { ws.refresh(false); - ws.view_offset_gesture_end(false, None); + ws.view_offset_gesture_end(None); } } } |
