aboutsummaryrefslogtreecommitdiff
path: root/src/output.zig
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2020-04-03 18:53:36 +0200
committerIsaac Freund <ifreund@ifreund.xyz>2020-04-04 16:51:02 +0200
commit6cb9f6ac04e1fc7716bd69707c714ae89599cccc (patch)
treed2b2e846a5f191b25e1853a0d60e5776f05b57c6 /src/output.zig
parent9ba295f12673f201b5d70fa3918e270ef41be9f7 (diff)
downloadriver-6cb9f6ac04e1fc7716bd69707c714ae89599cccc.tar.gz
river-6cb9f6ac04e1fc7716bd69707c714ae89599cccc.tar.xz
Add a data structure to manage the view stack
Diffstat (limited to 'src/output.zig')
-rw-r--r--src/output.zig21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/output.zig b/src/output.zig
index d3b3ffe..936ee51 100644
--- a/src/output.zig
+++ b/src/output.zig
@@ -4,6 +4,7 @@ const c = @import("c.zig");
const Root = @import("root.zig").Root;
const Server = @import("server.zig").Server;
const View = @import("view.zig").View;
+const ViewStack = @import("view_stack.zig").ViewStack;
const RenderData = struct {
output: *c.wlr_output,
@@ -79,22 +80,12 @@ pub const Output = struct {
const color = [_]f32{ 0.3, 0.3, 0.3, 1.0 };
c.wlr_renderer_clear(renderer, &color);
- // Each subsequent view is rendered on top of the last.
// The first view in the list is "on top" so iterate in reverse.
- var it = output.root.views.last;
- while (it) |node| : (it = node.prev) {
- const view = &node.data;
-
- // Only render currently visible views
- if (view.current_tags & output.root.current_focused_tags == 0) {
- continue;
- }
-
- // TODO: remove this check and move unmaped views back to unmaped TailQueue
- if (!view.mapped) {
- // An unmapped view should not be rendered.
- continue;
- }
+ var it = ViewStack.reverseIterator(
+ output.root.views.first,
+ output.root.current_focused_tags,
+ );
+ while (it.next()) |view| {
output.renderView(view, &now);
}