fix(wallpaper): resolve wpaperd links from link location

This commit is contained in:
Xuc Pan committed 2026-09-24 13:13:12 +08:00
1 parent 3dc3b62477
commit d47178916f
1 file changed
+3 -8
+3 -8
View File
@@ -324,14 +324,9 @@ fn wpaperd_link() -> Option<PathBuf> {
}
fn link_target(link: &Path) -> Option<PathBuf> {
let target = std::fs::read_link(link).ok()?;
Some(if target.is_absolute() {
target
} else {
// wpaperd stores config-relative targets, resolved against its
// working directory, which is the user's home in practice.
home_dir().join(target)
})
// Let the filesystem resolve relative symlink targets from the link's
// parent directory, as required by symlink semantics.
link.canonicalize().ok()
}
fn wallpaper_from_value(value: &str, provider: &'static str) -> Option<Wallpaper> {