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

commitd45b1b2d141d3de48341acd63a5f3f1c0a0c1588
parent00ace14d6a
authorIsaac Freund <[email protected]>
date2024-03-17 22:48
Root: increase transaction timeout to 100ms

This was dropped from 200ms to 50ms in 4a65af66. However 50ms seems
to be a bit too short in practice. I often hit ugly frame imperfection
do to timeouts when toggling mpv between a small floating window and
fullscreen for example, even on a relatively beefy desktop computer.

This only happens while the video is playing in mpv, not while it is
paused. I believe this is due to mpv ignoring the compositor's hints for
when to render a new frame entirely while playing a video. It instead
renders at the framerate of the video being played, even if the
compositor requests a change in size. This isn't great but seems
unlikely to change [1].

Overall, hitting 100ms timeouts subjectively doesn't feel anywhere near
as sluggish as hitting 200ms timeouts and offers better frame perfection
than 50ms timeouts in at least this one example, there are bound to be
others.

[1]: https://dudemanguy.github.io/blog/posts/2022-06-10-wayland-xorg/wayland-xorg.html

 river/Root.zig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/river/Root.zig b/river/Root.zig
index 76b642f..be2242a 100644
--- a/river/Root.zig
+++ b/river/Root.zig
@@ -607,7 +607,7 @@ fn sendConfigures(root: *Root) void {
             root.inflight_configures,
         });
 
-        root.transaction_timeout.timerUpdate(50) catch {
+        root.transaction_timeout.timerUpdate(100) catch {
             std.log.scoped(.transaction).err("failed to update timer", .{});
             root.commitTransaction();
         };