atagen

monolith

public
Star0
Watch0

Commit 45a383fca811

tarball

atagen <boss@atagen.co>2026-10-17 11:32 UTC

5 files changed+15-7
monolith: bring an empty tag into view when a window moves onto it too

Only newly mapped windows did, so sending a window to an empty tag hid it until the tag was toggled by hand, which is the case the option exists for.
Modified file: crates/config/default.toml+2 additions−2 deletions
@@ -17,8 +17,8 @@ focus_follows_mouse = false
1717 # Put the pointer in the middle of a window focused from the keyboard, a
1818 # rule or a new map. Bare metal only, a nested pointer belongs to the host.
1919 mouse_follows_focus = false
20-# A window landing on an empty tag that is not in view brings the tag into
21-# view, alongside the tags already shown.
20+# A window landing on or moved to an empty tag that is not in view brings
21+# the tag into view, alongside the tags already shown.
2222 view_tag_on_first_window = true
2323
2424 [decoration]
Modified file: crates/config/src/lib.rs+2 additions−2 deletions
@@ -33,8 +33,8 @@ pub struct General {
3333 pub move_mode: MoveMode,
3434 pub focus_follows_mouse: bool,
3535 pub mouse_follows_focus: bool,
36- /// The first window on an empty tag nobody is viewing brings that tag
37- /// into view on its output.
36+ /// The first window to land on or move to an empty tag nobody is
37+ /// viewing brings that tag into view on its output.
3838 pub view_tag_on_first_window: bool,
3939 }
4040
Modified file: crates/monolith/src/activation.rs+1 additions
@@ -58,6 +58,7 @@ impl XdgActivationHandler for State {
5858 && let Some(ctx) = ctx
5959 {
6060 self.wm.layout.relocate(id, ctx.output, ctx.tag);
61+ self.view_if_first(id);
6162 }
6263 let may_focus = ctx.is_some_and(|c| c.may_focus) && data.timestamp.elapsed() < FRESH;
6364 if may_focus && self.wm.layout.visible(id) {
Modified file: crates/monolith/src/commands.rs+1 additions
@@ -114,6 +114,7 @@ impl State {
114114 let t = self.wm.layout.tag(&tag);
115115 if let Some(w) = focused {
116116 self.wm.layout.set_tag(w, t);
117+ self.view_if_first(w);
117118 }
118119 }
119120 Command::ReorderTag { tag, index } => {
Modified file: crates/monolith/src/windows.rs+9 additions−3 deletions
@@ -60,9 +60,7 @@ impl State {
6060 if let Some(name) = &rule.scratchpad {
6161 self.wm.layout.scratchpad_add(id, name);
6262 }
63- if self.settings.config.general.view_tag_on_first_window {
64- self.wm.layout.view_if_alone(id);
65- }
63+ self.view_if_first(id);
6664 let by_rule = rule.tag.is_some() || rule.output.is_some();
6765 self.wm.insert(id, window, by_rule, app_id, title);
6866 self.await_first_buffer(id);
@@ -191,6 +189,14 @@ impl State {
191189 }
192190 }
193191
192+ /// Brings a window's tag into view when it is the tag's first window,
193+ /// whether it mapped there, was moved there or was placed by activation.
194+ pub fn view_if_first(&mut self, id: WindowId) {
195+ if self.settings.config.general.view_tag_on_first_window {
196+ self.wm.layout.view_if_alone(id);
197+ }
198+ }
199+
194200 pub fn window_id(&self, surface: &WlSurface) -> Option<WindowId> {
195201 self.wm.id_of(surface)
196202 }