Commit 4e3cbf4c6515
tarball2 files changed+14-3
@@ -246,9 +246,10 @@ impl State {
246246
}247247
248248
/// Floats a tiled window whose size hints, which GTK only sets after its249
- /// first configure, show it to be a dialog or fixed-size. It is still held250
- /// 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 dialog250
+ /// or fixed-size. At its first buffer it is still held on its seed, so it251
+ /// never shows tiled.252
+ pub(crate) fn float_if_hinted(&mut self, id: WindowId) -> bool {252253
let hinted = self253254
.wm254255
.window(id)@@ -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 = self107
+ .wm108
+ .layout109
+ .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>) {