! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
xfdesktop v4.12.0 does not redraw -R switch
Status:
RESOLVED: FIXED
Product:
Xfdesktop
Component:
General

Comments

Description John 2015-03-01 15:44:47 CET
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.
Comment 1 John 2015-03-02 21:51:20 CET
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?
Comment 2 Eric Koegel editbugs 2015-03-03 18:27:59 CET
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.
Comment 3 Pontus 2015-03-12 08:28:05 CET
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!
Comment 4 Eric Koegel editbugs 2015-03-15 12:57:14 CET
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.
Comment 5 John 2015-03-15 15:18:51 CET
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.
Comment 6 Eric Koegel editbugs 2015-03-15 15:45:47 CET
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);
Comment 7 Pontus 2015-03-16 14:06:15 CET
Works fine for me with the patch, my program rewrites the file and xfdesktop updates the background. :D
Comment 8 Eric Koegel editbugs 2015-03-16 14:37:27 CET
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.
Comment 9 John 2015-03-16 20:05:17 CET
Hooray!  Application of the two patches fixes the issue I reported.  Thanks you very much for the quick response, Eric,
Comment 10 Eric Koegel editbugs 2015-03-20 06:42:22 CET
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

Bug #11620

Reported by:
John
Reported on: 2015-03-01
Last modified on: 2015-03-20

People

Assignee:
Eric Koegel
CC List:
3 users

Version

Version:
Unspecified

Attachments

Additional information