output-management: work around wlroots crash

This commit is contained in:
Isaac Freund 2023-12-31 10:53:35 -06:00
parent 5f0c9e2ccf
commit a128a574a4
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11
2 changed files with 12 additions and 1 deletions

2
deps/zig-wlroots vendored

@ -1 +1 @@
Subproject commit 96dfdc14e99468f4aa6560c8397cd4d0eb0c2827 Subproject commit 9901da0c3b1a393248a13cc81bc282cfac8d687f

View File

@ -770,6 +770,17 @@ fn processOutputConfig(
var proposed_state = wlr.Output.State.init(); var proposed_state = wlr.Output.State.init();
head.state.apply(&proposed_state); 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) { switch (action) {
.test_only => { .test_only => {
if (!wlr_output.testState(&proposed_state)) success = false; if (!wlr_output.testState(&proposed_state)) success = false;