atagen

monolith

public
Star0
Watch0

Commit 5ab6f980c72f

tarball

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

2 files changed+24-0
monolith: bring an empty tag into view when its first window maps

general.view_tag_on_first_window, on by default, adds the tag beside the ones already shown instead of only marking it urgent, since a window landing alone on a hidden tag was usually launched to be seen.
Modified file: crates/layout/src/lib.rs+21 additions
@@ -250,6 +250,27 @@ impl Layout {
250250 }
251251 }
252252
253+ /// Brings `w`'s tag into view beside the others when `w` is the only
254+ /// window on it there.
255+ pub fn view_if_alone(&mut self, w: WindowId) {
256+ let Some(win) = self.windows.get(w) else {
257+ return;
258+ };
259+ let (Some(o), tag) = (win.output, win.tag) else {
260+ return;
261+ };
262+ if win.scratchpad.is_some() || self.is_viewed(o, tag) {
263+ return;
264+ }
265+ let alone = !self
266+ .windows
267+ .iter()
268+ .any(|(x, v)| x != w && v.output == Some(o) && v.tag == tag && v.scratchpad.is_none());
269+ if alone {
270+ self.toggle_view(o, tag);
271+ }
272+ }
273+
253274 /// The tag a launch from `o` belongs to. The focused window's tag, else
254275 /// the first viewed tag, else homeless. Homeless is always on screen, so
255276 /// focusing one of its windows does not mean the user left their tag.
Modified file: crates/monolith/src/windows.rs+3 additions
@@ -60,6 +60,9 @@ 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+ }
6366 let by_rule = rule.tag.is_some() || rule.output.is_some();
6467 self.wm.insert(id, window, by_rule, app_id, title);
6568 self.await_first_buffer(id);