Add open-maximized window rule

This commit is contained in:
Ivan Molodetskikh
2024-02-23 14:24:39 +04:00
parent 2317021a7c
commit 6a587245eb
5 changed files with 41 additions and 8 deletions
+15 -7
View File
@@ -109,16 +109,22 @@ impl CompositorHandler for State {
window.on_commit();
let (width, output) =
if let InitialConfigureState::Configured { width, output, .. } = state {
let (width, is_full_width, output) =
if let InitialConfigureState::Configured {
width,
is_full_width,
output,
..
} = state
{
// Check that the output is still connected.
let output =
output.filter(|o| self.niri.layout.monitor_for_output(o).is_some());
(width, output)
(width, is_full_width, output)
} else {
error!("window map must happen after initial configure");
(None, None)
(None, false, None)
};
let parent = window
@@ -140,14 +146,16 @@ impl CompositorHandler for State {
let output = if let Some(p) = parent {
// Open dialogs immediately to the right of their parent window.
self.niri.layout.add_window_right_of(&p, win, width, false)
self.niri
.layout
.add_window_right_of(&p, win, width, is_full_width)
} else if let Some(output) = &output {
self.niri
.layout
.add_window_on_output(output, win, width, false);
.add_window_on_output(output, win, width, is_full_width);
Some(output)
} else {
self.niri.layout.add_window(win, width, false)
self.niri.layout.add_window(win, width, is_full_width)
};
if let Some(output) = output.cloned() {