diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2020-04-22 22:50:03 +0200 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2020-04-22 22:51:18 +0200 |
| commit | 1362061c4cefc558470c188d894f75faaa4e9cb2 (patch) | |
| tree | 3e7228007807e02e7f6d372a96ff247800a91a5d /src/render.zig | |
| parent | 94760394b4b57fec09f4fed214dd2bf70993c857 (diff) | |
| download | river-1362061c4cefc558470c188d894f75faaa4e9cb2.tar.gz river-1362061c4cefc558470c188d894f75faaa4e9cb2.tar.xz | |
Implement floating views
Diffstat (limited to 'src/render.zig')
| -rw-r--r-- | src/render.zig | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/render.zig b/src/render.zig index 99bddc1..d8b46ec 100644 --- a/src/render.zig +++ b/src/render.zig @@ -39,6 +39,26 @@ pub fn renderOutput(output: *Output) void { if (view.current_box.width == 0 or view.current_box.height == 0) { continue; } + // Floating views are rendered on top of normal views + if (view.floating) { + continue; + } + renderView(output.*, view, &now); + renderBorders(output.*, view, &now); + } + + // Render floating views + it = ViewStack(View).reverseIterator(output.views.last, output.current_focused_tags); + while (it.next()) |node| { + const view = &node.view; + // This check prevents a race condition when a frame is requested + // between mapping of a view and the first configure being handled. + if (view.current_box.width == 0 or view.current_box.height == 0) { + continue; + } + if (!view.floating) { + continue; + } renderView(output.*, view, &now); renderBorders(output.*, view, &now); } |
