river: render floating views above the layout

This commit is contained in:
Isaac Freund 2023-03-02 15:10:10 +01:00
parent ecb959f068
commit 686ef11fc8
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11
2 changed files with 20 additions and 5 deletions

View File

@ -59,8 +59,10 @@ layers: struct {
background: *wlr.SceneTree, background: *wlr.SceneTree,
/// Bottom layer shell layer /// Bottom layer shell layer
bottom: *wlr.SceneTree, bottom: *wlr.SceneTree,
/// Tiled and floating views /// Views in the layout
views: *wlr.SceneTree, layout: *wlr.SceneTree,
/// Floating views
float: *wlr.SceneTree,
/// Top layer shell layer /// Top layer shell layer
top: *wlr.SceneTree, top: *wlr.SceneTree,
/// Fullscreen views /// Fullscreen views
@ -227,7 +229,8 @@ pub fn create(wlr_output: *wlr.Output) !void {
), ),
.background = try normal_content.createSceneTree(), .background = try normal_content.createSceneTree(),
.bottom = 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(), .top = try normal_content.createSceneTree(),
.fullscreen = try normal_content.createSceneTree(), .fullscreen = try normal_content.createSceneTree(),
.overlay = try normal_content.createSceneTree(), .overlay = try normal_content.createSceneTree(),

View File

@ -607,13 +607,25 @@ fn commitTransaction(root: *Self) void {
view.inflight_serial = null; 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)) (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); 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(); view.updateCurrent();
const enabled = view.current.tags & output.current.tags != 0; const enabled = view.current.tags & output.current.tags != 0;