From d47178916f375e894168aa138f7070a08c10d3ba Mon Sep 17 00:00:00 2001 From: Xuc Pan Date: Thu, 24 Sep 2026 13:04:41 +0800 Subject: [PATCH] fix(wallpaper): resolve wpaperd links from link location --- src/wallpaper.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/wallpaper.rs b/src/wallpaper.rs index 8f0a90e..fe19dfc 100644 --- a/src/wallpaper.rs +++ b/src/wallpaper.rs @@ -324,14 +324,9 @@ fn wpaperd_link() -> Option { } fn link_target(link: &Path) -> Option { - 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 {