mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user