From ba5e5a7603939bc395560496824ca34fa0ff2a9d Mon Sep 17 00:00:00 2001 From: amnweb <16545063+forumwt@users.noreply.github.com> Date: Fri, 25 Oct 2024 01:05:02 +0200 Subject: [PATCH] fix(wallpaper): prevent crashing on right-click. --- src/core/widgets/yasb/wallpapers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/widgets/yasb/wallpapers.py b/src/core/widgets/yasb/wallpapers.py index 8010b96..632a6d9 100644 --- a/src/core/widgets/yasb/wallpapers.py +++ b/src/core/widgets/yasb/wallpapers.py @@ -221,9 +221,9 @@ def change_background(self, image_path: str = None): new_wallpaper = image_path else: """Randomly select a new wallpaper and prevent the same wallpaper from being selected """ + new_wallpaper = random.choice(wallpapers) while new_wallpaper == self._last_image and len(wallpapers) > 1: new_wallpaper = random.choice(wallpapers) - new_wallpaper = random.choice(wallpapers) try: self.set_wallpaper(new_wallpaper)