From de43fb1f0e0487531f904d7038e0958c4792596c Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Mon, 11 Aug 2025 16:51:12 +0200 Subject: [PATCH] config: Ignore configs disabling every output --- src/config/mod.rs | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/config/mod.rs b/src/config/mod.rs index 4d66547c..6680cb11 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -479,7 +479,30 @@ impl Config { .map(Into::::into) .collect::>(); infos.sort(); - if let Some(configs) = self.dynamic_conf.outputs().config.get(&infos).cloned() { + + if let Some(configs) = self + .dynamic_conf + .outputs() + .config + .get(&infos) + .filter(|configs| { + if configs + .iter() + .all(|config| config.enabled == OutputState::Disabled) + { + if !configs.is_empty() { + error!( + "Broken config, all outputs disabled. Resetting... {:?}", + configs + ); + } + false + } else { + true + } + }) + .cloned() + { let known_good_configs = outputs .iter() .map(|output| { @@ -565,6 +588,15 @@ impl Config { output_state.update(); self.write_outputs(output_state.outputs()); } else { + if outputs + .iter() + .all(|o| o.config().enabled == OutputState::Disabled) + { + for output in &outputs { + output.config_mut().enabled = OutputState::Enabled; + } + } + // we don't have a config, so lets generate somewhat sane positions let mut w = 0; if !outputs.iter().any(|o| o.config().xwayland_primary) {