]> git.mdlowis.com Git - proto/labwc.git/commit
output: auto-select mode when enabling output by client request
authorJohn Lindgren <john@jlindgren.net>
Sun, 20 Oct 2024 18:17:19 +0000 (14:17 -0400)
committerJohan Malm <johanmalm@users.noreply.github.com>
Tue, 31 Dec 2024 16:32:42 +0000 (16:32 +0000)
commit03be489eb973279585e0ca4ddde9820e1017ca86
treee71edd36d62e44cfbbf7079462f951ce2695acd0
parenta5973c3b48b4dbe42c928f9a0c7ceba5c7e404b3
output: auto-select mode when enabling output by client request

If e.g. kanshi requests us to enable an output but does not specify the
mode, and the output has not previously been modeset, then the width +
height + refresh rate will all be zero. In this case, we should select
the best mode just as when auto-configuring a new output.

We need to do the mode auto-selection in both the test & commit stages
for consistency, so factor out a new output_test_auto() function to help
with this.

Remove a guard against a refresh rate of zero, which was a workaround
for wlroots 0.17 and is no longer needed -- it is incompatible with mode
auto-selection since the refresh rate is zero in that case.
src/output.c