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/monitor.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/monitor.rs')
| -rw-r--r-- | src/layout/monitor.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/layout/monitor.rs b/src/layout/monitor.rs index 0e5802cd..f5da804a 100644 --- a/src/layout/monitor.rs +++ b/src/layout/monitor.rs @@ -126,6 +126,31 @@ impl<W: LayoutElement> Monitor<W> { } } + pub fn add_window_right_of( + &mut self, + right_of: &W, + window: W, + activate: bool, + width: ColumnWidth, + is_full_width: bool, + ) { + let workspace_idx = self + .workspaces + .iter_mut() + .position(|ws| ws.has_window(right_of)) + .unwrap(); + let workspace = &mut self.workspaces[workspace_idx]; + + workspace.add_window_right_of(right_of, window, activate, width, is_full_width); + + // After adding a new window, workspace becomes this output's own. + workspace.original_output = OutputId::new(&self.output); + + if activate { + self.activate_workspace(workspace_idx); + } + } + pub fn add_column(&mut self, workspace_idx: usize, column: Column<W>, activate: bool) { let workspace = &mut self.workspaces[workspace_idx]; |
