aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarten Ringwelski <git@maringuu.de>2020-11-01 14:49:01 +0100
committerIsaac Freund <ifreund@ifreund.xyz>2020-11-02 14:08:00 +0100
commitd23b8a7f272690544d18cc0f1526213bcb83910e (patch)
treed5f153d648c55b3ab83a7072e6a619057f62d90e
parenta7459026f62481707a03ab2064f12a761c75f2f2 (diff)
downloadriver-d23b8a7f272690544d18cc0f1526213bcb83910e.tar.gz
river-d23b8a7f272690544d18cc0f1526213bcb83910e.tar.xz
code: Move wlr_output_layout_add from Output.init to Root.addOutput
-rw-r--r--river/Output.zig6
-rw-r--r--river/Root.zig6
2 files changed, 6 insertions, 6 deletions
diff --git a/river/Output.zig b/river/Output.zig
index 248d0fe..6d01ce4 100644
--- a/river/Output.zig
+++ b/river/Output.zig
@@ -121,12 +121,6 @@ pub fn init(self: *Self, root: *Root, wlr_output: *c.wlr_output) !void {
.height = 0,
};
} else {
- // Add the new output to the layout. The add_auto function arranges outputs
- // from left-to-right in the order they appear. A more sophisticated
- // compositor would let the user configure the arrangement of outputs in the
- // layout. This automatically creates an output global on the wl_display.
- c.wlr_output_layout_add_auto(root.wlr_output_layout, wlr_output);
-
// Ensure that a cursor image at the output's scale factor is loaded
// for each seat.
var it = root.server.input_manager.seats.first;
diff --git a/river/Root.zig b/river/Root.zig
index 4b34024..38fd24f 100644
--- a/river/Root.zig
+++ b/river/Root.zig
@@ -102,6 +102,12 @@ pub fn addOutput(self: *Self, wlr_output: *c.wlr_output) void {
};
self.outputs.append(node);
+ // Add the new output to the layout. The add_auto function arranges outputs
+ // from left-to-right in the order they appear. A more sophisticated
+ // compositor would let the user configure the arrangement of outputs in the
+ // layout. This automatically creates an output global on the wl_display.
+ c.wlr_output_layout_add_auto(self.wlr_output_layout, wlr_output);
+
// if we previously had no real outputs, move focus from the noop output
// to the new one.
if (self.outputs.len == 1) {