atagen

monolith

public
Star0
Watch0

Commit 9b461902c972

tarball

atagen <boss@atagen.co>2026-10-19 08:55 UTC

1 file changed+4-2
windows: let rules start windows fullscreen or without focus

map_window took fullscreen only from what the client asked and always focused a visible new window, so config could not stop a window stealing focus or force one fullscreen. A rule now overrides the client's fullscreen request and focus = false leaves the focus history alone.
Modified file: crates/monolith/src/windows.rs+4 additions−2 deletions
@@ -24,7 +24,8 @@ impl State {
2424 let facts = self.facts(&window, None);
2525 let rule = self.settings.config.placement(&facts.subject());
2626 let launch = self.launch_of(self.window_pid(&window));
27- let (fullscreen, fullscreen_output) = requested_fullscreen(&window);
27+ let (asked, fullscreen_output) = requested_fullscreen(&window);
28+ let fullscreen = rule.fullscreen.unwrap_or(asked);
2829 let output = rule
2930 .output
3031 .as_deref()
@@ -74,6 +75,7 @@ impl State {
7475 let natural_size =
7576 floating && !fullscreen && window.toplevel().is_some() && rule.size.is_none();
7677 let reclassify = !floating && rule.floating.is_none() && window.toplevel().is_some();
78+ let focus = rule.focus != Some(false);
7779 let shaped = rule.at.is_some() || rule.min_size.is_some() || rule.max_size.is_some();
7880 let positioned = rule.size.is_some() || (shaped && !natural_size && !fullscreen);
7981 self.wm.insert(id, window, by_rule, app_id, title, rule);
@@ -85,7 +87,7 @@ impl State {
8587 self.float_by_rule(id);
8688 }
8789 self.await_first_buffer(id);
88- if self.wm.layout.visible(id) && !self.wm.layout.covered(id) {
90+ if focus && self.wm.layout.visible(id) && !self.wm.layout.covered(id) {
8991 self.wm.layout.focus(id);
9092 }
9193 self.apply_layout();