diff options
| author | sodiboo <37938646+sodiboo@users.noreply.github.com> | 2025-08-05 15:27:28 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-05 06:27:28 -0700 |
| commit | 52c579d5567d0b16ae68177fad05c612baba38af (patch) | |
| tree | a121c14ea4f379f70acf319153642e55d8f9237d /src/ui/config_error_notification.rs | |
| parent | 5edd91d37b25a751880d3a7bd3b92f0016d0cdc4 (diff) | |
| download | niri-52c579d5567d0b16ae68177fad05c612baba38af.tar.gz niri-52c579d5567d0b16ae68177fad05c612baba38af.tar.bz2 niri-52c579d5567d0b16ae68177fad05c612baba38af.zip | |
fix hot reloading `/etc/niri/config.kdl` (#1907)
* refactor config load logic, and properly watch the system config path
* move config creation to niri-config, and make the errors a bit nicer
notably, "error creating config" is now a cause for "error loading
config", instead of it being one error and then "error loading config:
no such file or directory". also, failure to load a config is now
printed as an error level diagnostic (because it is indeed an error, not
just a warning you can shrug off)
* refactor watcher tests; add some new ones
now they check for the file contents too! and i added some tests for
ConfigPath::Regular, including a messy one with many symlink swaps
* fixes
---------
Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>
Diffstat (limited to 'src/ui/config_error_notification.rs')
| -rw-r--r-- | src/ui/config_error_notification.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ui/config_error_notification.rs b/src/ui/config_error_notification.rs index 9b414f00..4e976633 100644 --- a/src/ui/config_error_notification.rs +++ b/src/ui/config_error_notification.rs @@ -68,10 +68,9 @@ impl ConfigErrorNotification { ) } - pub fn show_created(&mut self, created_path: PathBuf) { - let created_path = Some(created_path); - if self.created_path != created_path { - self.created_path = created_path; + pub fn show_created(&mut self, created_path: &Path) { + if self.created_path.as_deref() != Some(created_path) { + self.created_path = Some(created_path.to_owned()); self.buffers.borrow_mut().clear(); } |
