Under v4.10, invoking the following would cause a draw of desktop wallpaper: DISPLAY=:0.0 /usr/bin/xfdesktop --reload This is not the case with version 4.12. The manpage leads me to think that this is a bug since the --reload or -R switch should do the same.
I should add more details to show you exactly my use case: 1) Point the xfdesktop to a wallpaper, let's call it /foo/bar.jpg 2) Copy over /foo/bar.jpg with any other jpg of your choosing. Under 4.10, issuing this command would refresh the background by re-reading /foo/bar.jpg and thus change the wallpaper: DISPLAY=:0.0 /usr/bin/xfdesktop --reload I can find no such command that works under 4.12. Can anyone else confirm this isn't working?
Oh right, we can actually make xfdesktop notice the file has changed and refresh automatically. http://git.xfce.org/xfce/xfdesktop/tree/src/xfce-backdrop.c#n263 Is where we need to handle the changed event for the current file.
I'm having the same problem. I've got a program generating my background image (saving it to a file), but can't get xfdesktop to reload it when it changes. Automatic refresh would be nice!
Created attachment 6081 Monitor the wallpaper file for changes Can you verify this patch works as you'd like it? It makes xfdesktop update the current background anytime it changes. In the future we should look into doing the same for the settings dialog.
Greetings, Eric. I applied the attached and rebuilt xfdesktop, but it does not seem to take effect upon logout/login. 1) Point xfdesktop my symlink /var/lib/backdrop-randomizer/pic.jpg The link target is /mnt/data/pics/foo.jpg 2) Change the symlink target to /mnt/data/pics/bar.jpg and run: DISPLAY=:0.0 /usr/bin/xfdesktop --reload No effect.
oh, I was modifying the file to test it, you want to update a symlink, maybe the file monitor doesn't notice that... Can you do xfdesktop -Q; xfdesktop --enable-debug & Then let your script update the background and see if it notices the file changing. XF_DEBUG("file changed: %s", changed_file); XF_DEBUG("image_path: %s", backdrop->priv->image_path);
Works fine for me with the patch, my program rewrites the file and xfdesktop updates the background. :D
Created attachment 6087 Reinitialize background when reloading desktop John, Can you try this patch? This makes the -r switch reload the wallpaper. It may be that we just add both patches, that way both conditions are covered.
Hooray! Application of the two patches fixes the issue I reported. Thanks you very much for the quick response, Eric,
Thanks for testing everyone, pushed both patches to master: commit e1829fa8da733da1f5f456b9500eafbc072cc4dd Author: Eric Koegel <eric.koegel@gmail.com> Date: Sun Mar 15 14:52:06 2015 +0300 Monitor the wallpaper file for changes (Bug #11620) Since Xfdesktop is already monitoring the wallpaper folder for files being added and removed, have it also monitor and update the current background when it is changed. This way user's custom scripts can update the background without having to reload all the desktop icons as well. http://git.xfce.org/xfce/xfdesktop/commit/?id=e1829fa8da733da1f5f456b9500eafbc072cc4dd commit d27729dba35d3df83d0ccde2fcf6017c87dcfe1e Author: Thaddaeus Tintenfisch <thad.fisch@gmail.com> Date: Sat Mar 14 12:00:04 2015 +0100 Reinitialize background when reloading desktop (Bug #11620) http://git.xfce.org/xfce/xfdesktop/commit/?id=d27729dba35d3df83d0ccde2fcf6017c87dcfe1e