varietywalls / variety

Wallpaper downloader and manager for Linux systems
http://peterlevi.com/variety
GNU General Public License v3.0
1.17k stars 140 forks source link

desktop “flashes” when clock updates #403

Open rotsee opened 3 years ago

rotsee commented 3 years ago

Version of Variety 0.8.4

Describe the bug

Context Every 60 seconds, the whole desktop background “flashes”. I think it's a quick dip-to-white or similar effect. The background is restored immediately.

This happens on a Ubuntu 20.10 default installation, and with no Gnome extensions enabled. Variety is set to update the background every 1 hour, and to display a clock. This seems to be related to the clock updating it's minute figure. Without the clock, there is no visible flash.

To Reproduce

  1. Set Variety to display a clock
  2. Wait for the minute to change

Relevant line from variety.log

INFO: 2020-11-29 17:34:00,018: clock_thread_method() 'clock_thread updates wallpaper'
INFO: 2020-11-29 17:34:00,019: do_set_wp() 'Calling do_set_wp with /home/leo/.config/variety/Downloaded/Unsplash/photo-1550517393-cf2794bc1a9d.jpg, time: 1606667640.019407'
INFO: 2020-11-29 17:34:00,022: compute_trimmed_offsets() 'Trimmed offsets debug info: w:4480, h:1440, ratio:3.111111, iw:2304, ih:1543, scw:4480, sch:3000, ho:0, vo:780'
INFO: 2020-11-29 17:34:00,022: build_imagemagick_clock_cmd() 'Applying clock filter: -density 100 -font `fc-match -f '%{file[0]}' 'Ubuntu Condensed:,:70'` -pointsize 70 -gravity SouthEast -fill '#00000044' -annotate 0x0+58+888 '17:34' -fill white -annotate 0x0+60+890 '17:34' -font `fc-match -f '%{file[0]}' 'Ubuntu Condensed:,:30'` -pointsize 30 -fill '#00000044' -annotate 0x0+58+838 'söndag, november 29' -fill white -annotate 0x0+60+840 'söndag, november 29''
INFO: 2020-11-29 17:34:00,023: build_imagemagick_clock_cmd() 'ImageMagick clock cmd: convert /home/leo/.config/variety/Downloaded/Unsplash/photo-1550517393-cf2794bc1a9d.jpg -scale 4480x1440^ -density 100 -font `fc-match -f '%{file[0]}' 'Ubuntu Condensed:,:70'` -pointsize 70 -gravity SouthEast -fill '#00000044' -annotate 0x0+58+888 '17:34' -fill white -annotate 0x0+60+890 '17:34' -font `fc-match -f '%{file[0]}' 'Ubuntu Condensed:,:30'` -pointsize 30 -fill '#00000044' -annotate 0x0+58+838 'söndag, november 29' -fill white -annotate 0x0+60+840 'söndag, november 29' /home/leo/.config/variety/wallpaper/wallpaper-clock-95aaa94a82f7e84f039c0a3d661cbb44.jpg'
INFO: 2020-11-29 17:34:00,954: update_indicator() 'Setting file info to: /home/leo/.config/variety/Downloaded/Unsplash/photo-1550517393-cf2794bc1a9d.jpg'
INFO: 2020-11-29 17:34:00,956: list_files() 'More than 1 files in the folders, stop listing'

Desktop environment and version Gnome 3.38.1

OS name and version

NAME="Ubuntu" VERSION="20.10 (Groovy Gorilla)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.10" VERSION_ID="20.10" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=groovy UBUNTU_CODENAME=groovy

fblais commented 3 years ago

I'm experiencing the very same issue. Variety 0.8.5. Debian bullseye x64 with XFCE 4.16.

peterlevi commented 3 years ago

I suppose the same thing happens if you simply change the wallpaper image from Variety? When clock updates, Variety generates a new wallpaper image and instructs the desktop environment to change the wallpaper. Most DEs handle this well and the transition between the two wallpapers is smooth. But some don't. The graphic setup of the system might also play a role here. There isn't much we can do here Variety-side, unless we decide to go for a completely different approach for showing the clock.

xionluhnis commented 2 years ago

Experienced the same issue on XFCE 4.12 for Ubuntu 18.04.

sudo apt list variety
Listing... Done
variety/bionic,bionic,now 0.6.7-1 all [installed]

It may not be the last version from git, but the issue is likely still there for what I describe below.

I fixed the issue on my side (yet to see it flicker again) by changing the way the background is reset in ~/.config/variety/scripts/set_wallpaper See the current last version.

If you search in that file, you should find something like

# XFCE
command -v xfconf-query >/dev/null 2>&1
rc=$?
if [[ $rc = 0 ]] ; then
    for i in $(xfconf-query -c xfce4-desktop -p /backdrop -l | grep -E -e "screen.*/monitor.*image-path$" -e "screen.*/monitor.*/last-image$"); do
        xfconf-query -c xfce4-desktop -p "$i" -n -t string -s "" 2> /dev/null
        xfconf-query -c xfce4-desktop -p "$i" -s "" 2> /dev/null
        xfconf-query -c xfce4-desktop -p "$i" -s "$WP" 2> /dev/null
    done
fi

Which I changed to a single call to xfconf-query as

# XFCE
command -v xfconf-query >/dev/null 2>&1
rc=$?
if [[ $rc = 0 ]] ; then
    for i in $(xfconf-query -c xfce4-desktop -p /backdrop -l | grep -E -e "screen.*/monitor.*image-path$" -e "screen.*/monitor.*/last-image$"); do
        xfconf-query -c xfce4-desktop -p "$i" -n -t string -s "$WP" 2> /dev/null
    done
fi

I suppose that the setting to null is an artifact of some old version that was not resetting things properly? I'm unclear why you'd need to do that if setting the value directly works (so I assume it did not in the past).

The flickering is due to the background going to "black" (no image) for a few frames in between the change. So a priori the flickering issue I was experiencing was not due to the system doing a bad job at changing the wallpaper, but the script doing the change using a suboptimal sequence of xfconf-query calls (at least for XFCE on a recent configuration?).

fblais commented 2 years ago

Thanks, that change is working great!

epidemicz commented 1 year ago

Thanks very much @xionluhnis. Your fix worked for me, the only exception being I have a separate set_wallpaper_arco file which needed your change applied to it. I am assuming that's because I'm running ArcoLinux.

DeN-AlB commented 9 months ago

Same issue here on Fedora / Nobara 39 with KDE desktop. Every minute the clock changes, there is a short flickering on the desktop.

I took a look into the set_wallpaper script, but I don't know what I have to change here ... Any help would be appreciated.