From 556d7906940e68f74e970dbf8eac3aa0f1aea87a Mon Sep 17 00:00:00 2001 From: Keith Hubbard Date: Thu, 5 Aug 2021 21:40:30 -0400 Subject: [PATCH] render: draw borders before rendering views Menus, tooltips, etc. can extend beyond a view's borders. Render views after their borders so floating content appears on top. Unfocused floating content can still be obscured by views higher in the stack and the focused view. --- river/render.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/river/render.zig b/river/render.zig index 8bbdac7..9c0bd52 100644 --- a/river/render.zig +++ b/river/render.zig @@ -93,32 +93,32 @@ pub fn renderOutput(output: *Output) void { it = ViewStack(View).iter(output.views.last, .reverse, output.current.tags, renderFilter); while (it.next()) |view| { if (view.current.focus != 0 or view.current.float) continue; - renderView(output, view, &now); if (view.draw_borders) renderBorders(output, view, &now); + renderView(output, view, &now); } // focused, non-floating views it = ViewStack(View).iter(output.views.last, .reverse, output.current.tags, renderFilter); while (it.next()) |view| { if (view.current.focus == 0 or view.current.float) continue; - renderView(output, view, &now); if (view.draw_borders) renderBorders(output, view, &now); + renderView(output, view, &now); } // non-focused, floating views it = ViewStack(View).iter(output.views.last, .reverse, output.current.tags, renderFilter); while (it.next()) |view| { if (view.current.focus != 0 or !view.current.float) continue; - renderView(output, view, &now); if (view.draw_borders) renderBorders(output, view, &now); + renderView(output, view, &now); } // focused, floating views it = ViewStack(View).iter(output.views.last, .reverse, output.current.tags, renderFilter); while (it.next()) |view| { if (view.current.focus == 0 or !view.current.float) continue; - renderView(output, view, &now); if (view.draw_borders) renderBorders(output, view, &now); + renderView(output, view, &now); } if (build_options.xwayland) renderXwaylandUnmanaged(output, &now);