atagen

monolith

public
Star0
Watch0

Commit 4e3cbf4c6515

tarball

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

2 files changed+14-3
xdg: relayout when a mapped toplevel gains a parent

parent_changed only re-ran rules, which after the first buffer follow just effects, so a dialog given a fullscreen parent through xdg-foreign stayed hidden behind it and a tiled one never floated.
Modified file: crates/monolith/src/windows.rs+4 additions−3 deletions
@@ -246,9 +246,10 @@ impl State {
246246 }
247247
248248 /// Floats a tiled window whose size hints, which GTK only sets after its
249- /// first configure, show it to be a dialog or fixed-size. It is still held
250- /// on its seed, so it never shows tiled.
251- fn float_if_hinted(&mut self, id: WindowId) -> bool {
249+ /// first configure, or a parent set after mapping show it to be a dialog
250+ /// or fixed-size. At its first buffer it is still held on its seed, so it
251+ /// never shows tiled.
252+ pub(crate) fn float_if_hinted(&mut self, id: WindowId) -> bool {
252253 let hinted = self
253254 .wm
254255 .window(id)
Modified file: crates/monolith/src/xdg.rs+10 additions
@@ -103,8 +103,18 @@ impl XdgShellHandler for State {
103103 return;
104104 };
105105 let parent = self.wm.get(id).and_then(|s| self.parent_of(&s.window));
106+ let had_parent = self
107+ .wm
108+ .layout
109+ .window(id)
110+ .is_some_and(|w| w.parent.is_some());
106111 self.wm.layout.set_parent(id, parent);
107112 self.rematch(id);
113+ let free = self.wm.get(id).is_some_and(|s| s.rule.floating.is_none());
114+ if !had_parent && parent.is_some() && free {
115+ self.float_if_hinted(id);
116+ }
117+ self.apply_layout();
108118 }
109119
110120 fn fullscreen_request(&mut self, surface: ToplevelSurface, output: Option<WlOutput>) {