diff --git a/README.md b/README.md index 7cb9bea..206e8ff 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,7 @@ choose the one that seems best suited to you (crontab, gnome start at launch, et * [LINUX] Only Gnome is natively supported, to use this application with another Desktop Environment, you have to use `exec_apply_wallpaper` option in the configuration file +* [MACOS] Dock, don't refresh wallpaper. This application have a workaround (but sometime Dock wins) * [WINDOWS] Parameter `--nowindow` (or `-w`) not working if you use Terminal as default console. Terminal don't honor Windows API and don't allow application to detach from terminal. As workaround, you could create a shortcut and configure it to enable the diff --git a/src/bingwallpaper/bingwallpaperchanger.rs b/src/bingwallpaper/bingwallpaperchanger.rs index 937444d..d3221e7 100644 --- a/src/bingwallpaper/bingwallpaperchanger.rs +++ b/src/bingwallpaper/bingwallpaperchanger.rs @@ -140,7 +140,10 @@ impl BingWallpaperChanger { } #[cfg(target_os = "macos")] { - self.change_wallpaper_macos(); + // Loop is needed to force Dock to refresh wallpaper :( + for _ in 0..20 { + self.change_wallpaper_macos(); + } } #[cfg(target_os = "windows")] { @@ -242,7 +245,7 @@ impl BingWallpaperChanger { .expect("Can't change wallpaper"); child.wait().expect("Can't wait for child process"); - std::thread::sleep(std::time::Duration::from_secs(1)); + //std::thread::sleep(std::time::Duration::from_secs(1)); fs::remove_file(&tmp_filename).unwrap(); fs::remove_file(swift_script_path).unwrap(); }