config/output: Search for output config fallbacks

The original sway output config implementation enabled one output at a
time, testing modes, render formats and VRR support as it went along.
While this sort of fallback is easy to do, it has the downside of not
considering the effect of neighbor outputs on the configuration
viability.

With backend-wide commits, we can now better consider the effect of
neighbor outputs, but to handle the fact that we commit all outputs at
once we need to perform a more elaborate search of viable
configurations.

Implement a recursive configuration search for when the primary
configuration failed to apply.
This commit is contained in:
Kenny Levinsen 2024-03-28 14:26:05 +01:00
parent ee5c4f38c9
commit 4c28916d68
3 changed files with 261 additions and 55 deletions

View file

@ -609,7 +609,8 @@ static void output_manager_apply(struct sway_server *server,
}
}
bool ok = apply_output_configs(configs, configs_len, test_only);
sort_output_configs_by_priority(configs, configs_len);
bool ok = apply_output_configs(configs, configs_len, test_only, false);
for (size_t idx = 0; idx < configs_len; idx++) {
struct matched_output_config *cfg = &configs[idx];