diff options
| author | rustn00b <83183600+rustn00b@users.noreply.github.com> | 2025-01-09 08:29:36 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-09 08:29:36 +0000 |
| commit | 80815a1591aa3362a5e1c095e9ab81b2945041a7 (patch) | |
| tree | a09a434ff35efc61e1596a34d7d90ba5f69f4111 /src/layout/monitor.rs | |
| parent | 8412bfb8136544549e3174fd48859d0be0090c78 (diff) | |
| download | niri-80815a1591aa3362a5e1c095e9ab81b2945041a7.tar.gz niri-80815a1591aa3362a5e1c095e9ab81b2945041a7.tar.bz2 niri-80815a1591aa3362a5e1c095e9ab81b2945041a7.zip | |
Add a window swap operation (#899)
Swap the active window with the a neighboring column's active window.
---------
Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>
Take into account PR comments
- no longer behave like an expel when a swap is made in a direction
where there is no column to swap with
- fix janky animation
Diffstat (limited to 'src/layout/monitor.rs')
| -rw-r--r-- | src/layout/monitor.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/layout/monitor.rs b/src/layout/monitor.rs index 2de3c760..57ca7f53 100644 --- a/src/layout/monitor.rs +++ b/src/layout/monitor.rs @@ -9,7 +9,7 @@ use smithay::backend::renderer::element::utils::{ use smithay::output::Output; use smithay::utils::{Logical, Point, Rectangle, Size}; -use super::scrolling::{Column, ColumnWidth}; +use super::scrolling::{Column, ColumnWidth, ScrollDirection}; use super::tile::Tile; use super::workspace::{ OutputId, Workspace, WorkspaceAddWindowTarget, WorkspaceId, WorkspaceRenderElement, @@ -707,6 +707,10 @@ impl<W: LayoutElement> Monitor<W> { self.active_workspace().expel_from_column(); } + pub fn swap_window_in_direction(&mut self, direction: ScrollDirection) { + self.active_workspace().swap_window_in_direction(direction); + } + pub fn center_column(&mut self) { self.active_workspace().center_column(); } |
