mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
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
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user