mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2024-12-26 21:58:10 +01:00
Move state clearing on config start to front
This commit is contained in:
parent
bf92d12795
commit
45bf9b698c
1 changed files with 15 additions and 21 deletions
|
@ -270,12 +270,23 @@ impl State {
|
|||
///
|
||||
/// If `config_dir` is `None`, the builtin Rust config will be used.
|
||||
pub fn start_config(&mut self, mut config_dir: Option<impl AsRef<Path>>) -> anyhow::Result<()> {
|
||||
if let Some(shutdown_sender) = self.config.shutdown_sender.take() {
|
||||
if let Err(err) = shutdown_sender.send(Ok(ShutdownWatchResponse {})) {
|
||||
warn!("Failed to send shutdown signal to config: {err}");
|
||||
}
|
||||
// Clear state
|
||||
|
||||
debug!("Clearing tags");
|
||||
for output in self.space.outputs() {
|
||||
output.with_state_mut(|state| state.tags.clear());
|
||||
}
|
||||
|
||||
TagId::reset();
|
||||
|
||||
debug!("Clearing input state");
|
||||
|
||||
self.input_state.clear();
|
||||
|
||||
self.config.clear(&self.loop_handle);
|
||||
|
||||
self.signal_state.clear();
|
||||
|
||||
let config_dir_clone = config_dir.as_ref().map(|dir| dir.as_ref().to_path_buf());
|
||||
let load_default_config = |state: &mut State, reason: &str| {
|
||||
match &config_dir_clone {
|
||||
|
@ -305,23 +316,6 @@ impl State {
|
|||
.expect("builtin metaconfig was malformed; this is a bug"),
|
||||
};
|
||||
|
||||
// Clear state
|
||||
|
||||
debug!("Clearing tags");
|
||||
for output in self.space.outputs() {
|
||||
output.with_state_mut(|state| state.tags.clear());
|
||||
}
|
||||
|
||||
TagId::reset();
|
||||
|
||||
debug!("Clearing input state");
|
||||
|
||||
self.input_state.clear();
|
||||
|
||||
self.config.clear(&self.loop_handle);
|
||||
|
||||
self.signal_state.clear();
|
||||
|
||||
let reload_keybind = metaconfig.reload_keybind;
|
||||
let kill_keybind = metaconfig.kill_keybind;
|
||||
|
||||
|
|
Loading…
Reference in a new issue