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

commit992484cf123a997be66f3ee6540b5a8608a1f55b
parent4f5014f3b6
authorIsaac Freund <[email protected]>
date2024-12-27 11:15
WindowManager: commit transaction on update timeout

 river/WindowManager.zig | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/river/WindowManager.zig b/river/WindowManager.zig
index 6fecfdf..0006975 100644
--- a/river/WindowManager.zig
+++ b/river/WindowManager.zig
@@ -377,14 +377,10 @@ fn cancelTimeoutTimer(wm: *WindowManager) void {
 fn handleTimeout(wm: *WindowManager) c_int {
     log.err("timeout occurred, some imperfect frames may be shown", .{});
 
-    switch (wm.state) {
-        .idle => unreachable,
-        .update_sent, .update_acked => wm.state = .idle,
-        .inflight_configures => {
-            wm.state.inflight_configures = 0;
-            wm.commitTransaction();
-        },
-    }
+    assert(wm.state != .idle);
+
+    wm.state = .{ .inflight_configures = 0 };
+    wm.commitTransaction();
 
     return 0;
 }