From a128a574a4c19d0d33337449814b76b95953da68 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Sun, 31 Dec 2023 10:53:35 -0600 Subject: output-management: work around wlroots crash --- deps/zig-wlroots | 2 +- river/Root.zig | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/deps/zig-wlroots b/deps/zig-wlroots index 96dfdc1..9901da0 160000 --- a/deps/zig-wlroots +++ b/deps/zig-wlroots @@ -1 +1 @@ -Subproject commit 96dfdc14e99468f4aa6560c8397cd4d0eb0c2827 +Subproject commit 9901da0c3b1a393248a13cc81bc282cfac8d687f diff --git a/river/Root.zig b/river/Root.zig index b0c1d8d..a3bd35a 100644 --- a/river/Root.zig +++ b/river/Root.zig @@ -770,6 +770,17 @@ fn processOutputConfig( var proposed_state = wlr.Output.State.init(); head.state.apply(&proposed_state); + // Work around a division by zero in the wlroots drm backend. + // See https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3791 + // TODO(wlroots) remove this workaround after 0.17.2 is out. + if (output.wlr_output.isDrm() and + proposed_state.committed.mode and + proposed_state.mode_type == .custom and + proposed_state.custom_mode.refresh == 0) + { + proposed_state.custom_mode.refresh = 60000; + } + switch (action) { .test_only => { if (!wlr_output.testState(&proposed_state)) success = false; -- cgit v1.2.3