smarter generation calls when switching between favorites + plus adds a conditional explicit call to generate new colours which solves lysecs bug.

This commit is contained in:
tuibird
2026-02-12 16:33:20 +13:00
parent 57ec0d8359
commit 049f7c9444
+11 -2
View File
@@ -989,12 +989,21 @@ Singleton {
if (!favorite)
return;
// Only update settings — generation is handled by the wallpaperChanged
// signal in AppThemeService, which fires after changeWallpaper().
// Track which auto-triggered properties are changing to avoid redundant generation calls
var generationMethodChanging = Settings.data.colorSchemes.generationMethod !== favorite.generationMethod;
var darkModeChanging = Settings.data.colorSchemes.darkMode !== favorite.darkMode;
// Update settings to match the favorite's saved color scheme
Settings.data.colorSchemes.useWallpaperColors = favorite.useWallpaperColors;
Settings.data.colorSchemes.predefinedScheme = favorite.colorScheme;
Settings.data.colorSchemes.generationMethod = favorite.generationMethod;
Settings.data.colorSchemes.darkMode = favorite.darkMode;
// Only explicitly trigger generation if the auto-triggered properties didn't change.
// If generationMethod or darkMode changed, their change handlers already called generate().
if (!generationMethodChanging && !darkModeChanging) {
AppThemeService.generate();
}
}
// -------------------------------------------------------------------