aboutsummaryrefslogtreecommitdiff
path: root/src/root.zig
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2020-04-14 13:46:40 +0200
committerIsaac Freund <ifreund@ifreund.xyz>2020-04-14 13:46:40 +0200
commit6e2ad0583cec0668ffafac93316b26c0d9d18073 (patch)
tree83703c90c56e96ae464e065810816c43e6c3e4eb /src/root.zig
parent93f4133812972ca216dc387e78e5b89a3a008a00 (diff)
downloadriver-6e2ad0583cec0668ffafac93316b26c0d9d18073.tar.gz
river-6e2ad0583cec0668ffafac93316b26c0d9d18073.tar.xz
Add a noop output using the noop backend
This is intended for use when no real outputs are available.
Diffstat (limited to 'src/root.zig')
-rw-r--r--src/root.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/root.zig b/src/root.zig
index 0c470d2..bbda4b9 100644
--- a/src/root.zig
+++ b/src/root.zig
@@ -19,6 +19,9 @@ pub const Root = struct {
wlr_output_layout: *c.wlr_output_layout,
outputs: std.TailQueue(Output),
+ /// This output is used when no real outputs are available.
+ noop_output: Output,
+
/// Number of pending configures sent in the current transaction.
/// A value of 0 means there is no current transaction.
pending_configures: u32,
@@ -37,6 +40,10 @@ pub const Root = struct {
self.outputs = std.TailQueue(Output).init();
+ const noop_wlr_output = c.river_wlr_noop_add_output(server.noop_backend) orelse
+ return error.CantAddNoopOutput;
+ try self.noop_output.init(self, noop_wlr_output);
+
self.pending_configures = 0;
self.transaction_timer = null;