From 686ef11fc8462785bbeec73f0244d14e97dff578 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Thu, 2 Mar 2023 15:10:10 +0100 Subject: [PATCH] river: render floating views above the layout --- river/Output.zig | 9 ++++++--- river/Root.zig | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/river/Output.zig b/river/Output.zig index 4c34436..828b85d 100644 --- a/river/Output.zig +++ b/river/Output.zig @@ -59,8 +59,10 @@ layers: struct { background: *wlr.SceneTree, /// Bottom layer shell layer bottom: *wlr.SceneTree, - /// Tiled and floating views - views: *wlr.SceneTree, + /// Views in the layout + layout: *wlr.SceneTree, + /// Floating views + float: *wlr.SceneTree, /// Top layer shell layer top: *wlr.SceneTree, /// Fullscreen views @@ -227,7 +229,8 @@ pub fn create(wlr_output: *wlr.Output) !void { ), .background = try normal_content.createSceneTree(), .bottom = try normal_content.createSceneTree(), - .views = try normal_content.createSceneTree(), + .layout = try normal_content.createSceneTree(), + .float = try normal_content.createSceneTree(), .top = try normal_content.createSceneTree(), .fullscreen = try normal_content.createSceneTree(), .overlay = try normal_content.createSceneTree(), diff --git a/river/Root.zig b/river/Root.zig index 518d94a..7245e58 100644 --- a/river/Root.zig +++ b/river/Root.zig @@ -607,13 +607,25 @@ fn commitTransaction(root: *Self) void { view.inflight_serial = null; - if (view.current.output != output or + if (view.current.output != view.inflight.output or (output.current.fullscreen == view and output.inflight.fullscreen != view)) { - view.tree.node.reparent(output.layers.views); + if (view.inflight.float) { + view.tree.node.reparent(output.layers.float); + } else { + view.tree.node.reparent(output.layers.layout); + } view.popup_tree.node.reparent(output.layers.popups); } + if (view.current.float != view.inflight.float) { + if (view.inflight.float) { + view.tree.node.reparent(output.layers.float); + } else { + view.tree.node.reparent(output.layers.layout); + } + } + view.updateCurrent(); const enabled = view.current.tags & output.current.tags != 0;