atagen

monolith

public
Star0
Watch0

Commit d518445619bb

tarball

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

1 file changed+10-0
monolith: publish only tags in use as workspaces

ext-workspace has no occupied state, so bars built for compositors that reap empty workspaces read a workspace's existence as having windows. Publishing every tag made them all look occupied. A tag now appears on an output while it holds windows there or is viewed there.
Modified file: crates/monolith/src/state.rs+10 additions
@@ -602,13 +602,23 @@ impl State {
602602 return;
603603 }
604604 let l = &self.layout;
605+ let occupied: HashSet<(OutputId, monolith_layout::TagId)> = l
606+ .windows()
607+ .filter(|(_, w)| w.scratchpad.is_none())
608+ .filter_map(|(_, w)| Some((w.output?, w.tag)))
609+ .collect();
605610 let groups = l
606611 .outputs()
607612 .filter_map(|(o, _)| {
608613 let output = self.smithay_output(o)?;
614+ // Bars read a tag's existence as having windows, as with
615+ // workspaces that come and go, so empty unviewed tags are left out.
609616 let workspaces = l
610617 .tags()
611618 .enumerate()
619+ .filter(|&(_, (t, _))| {
620+ occupied.contains(&(o, t)) || (t != l.homeless() && l.is_viewed(o, t))
621+ })
612622 .map(|(i, (t, tag))| Workspace {
613623 key: tag.name.clone(),
614624 name: tag.name.clone(),