Rawns / Reddit-Wallpaper-Changer

Reddit Wallpaper Changer
MIT License
121 stars 51 forks source link

Fix for Issue #23 #27

Closed benedikt257 closed 7 years ago

benedikt257 commented 7 years ago

As described in Issue #23 RWC stops looking for wallpapers when finding a wallpaper from deviantart and then timing out on the HttpWebRequest that checks whether the url links to an image file.

As far as I can tell, this is due to the Timer breakBetweenChange being restarted in a BackgroundWorker's thread with no effect on the main thread. This commit fixes that by adding a method that invokes a Timer from the main thread. I replaced all .Enabled = true; calls that were made from DoWork delegates in setWallpaper and changeWallpaper.

I have been running RWC for a few hours now with wallpaper changes every minute and so far I have not noticed any stops in the cycle.

I have not fixed RWC not being able to fetch deviantart wallpapers yet, I leave that to @Rawns ;-)