diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-28 10:13:30 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-30 20:12:37 +0300 |
| commit | ad50dd21fea1912b9e21fb66a22fce517dac3aee (patch) | |
| tree | 20d7f1a1d6db2a843a33a551d5895bcc86cf0f38 /src/layout/workspace.rs | |
| parent | 8b0cb0bb57112bd15bc7ac04e6952d857dadcbca (diff) | |
| download | niri-ad50dd21fea1912b9e21fb66a22fce517dac3aee.tar.gz niri-ad50dd21fea1912b9e21fb66a22fce517dac3aee.tar.bz2 niri-ad50dd21fea1912b9e21fb66a22fce517dac3aee.zip | |
Add move-window-to-floating/tiling actions
Diffstat (limited to 'src/layout/workspace.rs')
| -rw-r--r-- | src/layout/workspace.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/layout/workspace.rs b/src/layout/workspace.rs index cd1a6261..099b449c 100644 --- a/src/layout/workspace.rs +++ b/src/layout/workspace.rs @@ -1146,6 +1146,17 @@ impl<W: LayoutElement> Workspace<W> { tile.animate_move_from(render_pos - new_render_pos); } + pub fn set_window_floating(&mut self, id: Option<&W::Id>, floating: bool) { + if id.map_or(self.floating_is_active.get(), |id| { + self.floating.has_window(id) + }) == floating + { + return; + } + + self.toggle_window_floating(id); + } + pub fn switch_focus_floating_tiling(&mut self) { if self.floating.is_empty() { // If floating is empty, keep focus on scrolling. |
