anufrievroman / waypaper

GUI wallpaper manager for Wayland and Xorg Linux systems
https://anufrievroman.gitbook.io/waypaper
GNU General Public License v3.0
277 stars 11 forks source link

fix: Hyprpaper would unload wallpaper before being applied. #50

Closed nikolaizombie1 closed 1 month ago

nikolaizombie1 commented 1 month ago

I fixed a bug where hyprpaper would unload wallpapers after being applied. In the majority of cases, the wallpaper would apply correctly in spite of them being unloaded from memory. However, larger wallpapers would be unloaded before being applied to the screen. The unload command worked as intended after the fix, it would drastically reduce the memory consumption of hyprpaper when viewing wallpapers in waypaper and effectively cap memory consumption instead of constantly growing as was happening before.

anufrievroman commented 1 month ago

Thank you! Indeed, 0.1s sleep (or even longer) is probably not enough to load large wallpapers so it's better to do unload unused before preloading new. In this case, one unused wallpaper (that one that was just changed) will always stay in the memory (which is not a big deal), but I guess it's most sure way to change them quickly and reliably, so let's keep it this way. Also, then sleep before unload is not necessary I guess...

nikolaizombie1 commented 1 month ago

Thank you! Indeed, 0.1s sleep (or even longer) is probably not enough to load large wallpapers so it's better to do unload unused before preloading new. In this case, one unused wallpaper (that one that was just changed) will always stay in the memory (which is not a big deal), but I guess it's most sure way to change them quickly and reliably, so let's keep it this way. Also, then sleep before unload is not necessary I guess...

I'll remove the sleeps and see if it still functions reliably.

nikolaizombie1 commented 1 month ago

I removed the delays and it still worked reliably.