git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commit9d48807b552316d929979d66c369cc399155eee1
parent9737ec5019
authorIsaac Freund <[email protected]>
date2020-04-27 10:35
Simplify some code

 src/output.zig | 6 +-----
 src/root.zig   | 5 ++---
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/output.zig b/src/output.zig
index 91c2b89..7933831 100644
--- a/src/output.zig
+++ b/src/output.zig
@@ -143,14 +143,10 @@ pub const Output = struct {
         self.arrangeLayers();
     }
 
-    pub fn arrange(self: *Self) void {
-        self.arrangeViews();
-    }
-
     /// Arrange all views on the output for the current layout. Modifies only
     /// pending state, the changes are not appplied until a transaction is started
     /// and completed.
-    fn arrangeViews(self: *Self) void {
+    pub fn arrangeViews(self: *Self) void {
         // If the output has a zero dimension, trying to arrange would cause
         // underflow and is pointless anyway
         if (self.usable_box.width == 0 or self.usable_box.height == 0) {
diff --git a/src/root.zig b/src/root.zig
index de88466..eaaf5d8 100644
--- a/src/root.zig
+++ b/src/root.zig
@@ -86,9 +86,8 @@ pub const Root = struct {
     /// Arrange all outputs and then a transaction.
     pub fn arrange(self: *Self) void {
         var it = self.outputs.first;
-        while (it) |node| : (it = node.next) {
-            const output = &node.data;
-            output.arrange();
+        while (it) |output_node| : (it = output_node.next) {
+            output_node.data.arrangeViews();
         }
         self.startTransaction();
     }