diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-02-07 10:49:01 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-02-07 10:49:01 +0400 |
| commit | 9896fd67a0dcdade5f05568aa7b12fa17605976b (patch) | |
| tree | d61647ec4c805629976f7c7c8b271bce2403b882 /src/layout/workspace.rs | |
| parent | 15ec699fbbc9fc7fe1c865aa96584bec15fd2831 (diff) | |
| download | niri-9896fd67a0dcdade5f05568aa7b12fa17605976b.tar.gz niri-9896fd67a0dcdade5f05568aa7b12fa17605976b.tar.bz2 niri-9896fd67a0dcdade5f05568aa7b12fa17605976b.zip | |
Open dialogs to the right of their parent, don't steal focus
Diffstat (limited to 'src/layout/workspace.rs')
| -rw-r--r-- | src/layout/workspace.rs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/layout/workspace.rs b/src/layout/workspace.rs index 6e2a7c00..47be5877 100644 --- a/src/layout/workspace.rs +++ b/src/layout/workspace.rs @@ -555,6 +555,43 @@ impl<W: LayoutElement> Workspace<W> { } } + pub fn add_window_right_of( + &mut self, + right_of: &W, + window: W, + activate: bool, + width: ColumnWidth, + is_full_width: bool, + ) { + self.enter_output_for_window(&window); + + let idx = self + .columns + .iter() + .position(|col| col.contains(right_of)) + .unwrap() + + 1; + + let column = Column::new( + window, + self.view_size, + self.working_area, + self.options.clone(), + width, + is_full_width, + ); + self.columns.insert(idx, column); + + if self.active_column_idx >= idx { + self.active_column_idx += 1; + } + + if activate { + self.activate_column(idx); + self.activate_prev_column_on_removal = true; + } + } + pub fn add_column(&mut self, mut column: Column<W>, activate: bool) { for tile in &column.tiles { self.enter_output_for_window(tile.window()); |
