diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-02-12 20:53:19 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-02-12 20:56:32 +0300 |
| commit | ef80bcc83414d2e9a1cd14cc62ee021968e67128 (patch) | |
| tree | a4bda62687da273dc76f07159e119792966f8e7f /src/niri.rs | |
| parent | eb8bd3894a188d34d870f4d79813f75163a318b8 (diff) | |
| download | niri-ef80bcc83414d2e9a1cd14cc62ee021968e67128.tar.gz niri-ef80bcc83414d2e9a1cd14cc62ee021968e67128.tar.bz2 niri-ef80bcc83414d2e9a1cd14cc62ee021968e67128.zip | |
Parse the config on the file watcher thread
It takes a while, so let's not block the main thread.
Diffstat (limited to 'src/niri.rs')
| -rw-r--r-- | src/niri.rs | 7 |
1 files changed, 3 insertions, 4 deletions
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<Config, ()>) { 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; |
