From ab879e245cbc317e3a2f5ec0379143d4b25b3cfe Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Sun, 29 Dec 2024 16:09:44 -0600 Subject: [PATCH] Output: check scene damage before rendering This should fix adaptive sync/VRR, which was regressed by db7de8151. --- river/Output.zig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/river/Output.zig b/river/Output.zig index d4490c3..34e49dd 100644 --- a/river/Output.zig +++ b/river/Output.zig @@ -542,6 +542,13 @@ fn handleFrame(listener: *wl.Listener(*wlr.Output), _: *wlr.Output) void { } fn renderAndCommit(output: *Output, scene_output: *wlr.SceneOutput) !void { + // TODO(wlroots): replace this with wlr_scene_output_needs_frame() + if (!output.wlr_output.needs_frame and !output.gamma_dirty and + !scene_output.pending_commit_damage.notEmpty()) + { + return; + } + var state = wlr.Output.State.init(); defer state.finish();