From ef80bcc83414d2e9a1cd14cc62ee021968e67128 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Wed, 12 Feb 2025 20:53:19 +0300 Subject: Parse the config on the file watcher thread It takes a while, so let's not block the main thread. --- src/niri.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/niri.rs') diff --git a/src/niri.rs b/src/niri.rs index b1b9a90c..6dc38bc3 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -1118,13 +1118,12 @@ impl State { } } - pub fn reload_config(&mut self, path: PathBuf) { + pub fn reload_config(&mut self, config: Result) { let _span = tracy_client::span!("State::reload_config"); - let mut config = match Config::load(&path) { + let mut config = match config { Ok(config) => config, - Err(err) => { - warn!("{:?}", err.context("error loading config")); + Err(()) => { self.niri.config_error_notification.show(); self.niri.queue_redraw_all(); return; -- cgit