From 1362061c4cefc558470c188d894f75faaa4e9cb2 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Wed, 22 Apr 2020 22:50:03 +0200 Subject: Implement floating views --- src/render.zig | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/render.zig') 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); } -- cgit v1.2.3