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

commitca2a8a4a8af4d2631e3b438e551ad0b7e08311a4
parent7d8ab13c93
authorIsaac Freund <[email protected]>
date2020-04-17 19:37
Only log transactions if actually started

 src/root.zig | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/root.zig b/src/root.zig
index 8a101fa..eb7b0f3 100644
--- a/src/root.zig
+++ b/src/root.zig
@@ -141,18 +141,19 @@ pub const Root = struct {
             }
         }
 
-        Log.Debug.log(
-            "Started transaction with {} pending configures.",
-            .{self.pending_configures},
-        );
-
         if (self.pending_configures > 0) {
+            Log.Debug.log(
+                "Started transaction with {} pending configures.",
+                .{self.pending_configures},
+            );
+
             // TODO: log failure to create timer and commit immediately
             self.transaction_timer = c.wl_event_loop_add_timer(
                 self.server.wl_event_loop,
                 handle_timeout,
                 self,
             );
+
             // Set timeout to 200ms
             if (c.wl_event_source_timer_update(self.transaction_timer, 200) == -1) {
                 // TODO: handle failure