From 46bc8939b490b70f476e53901112f065b7b01f4c Mon Sep 17 00:00:00 2001 From: Ly-sec Date: Thu, 4 Sep 2025 18:23:46 +0200 Subject: [PATCH] Hooks: make hook activate after settings are updated --- Modules/Launcher/Plugins/ApplicationsPlugin.qml | 4 ++-- Services/WallpaperService.qml | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Modules/Launcher/Plugins/ApplicationsPlugin.qml b/Modules/Launcher/Plugins/ApplicationsPlugin.qml index 36661b0..4c02e6b 100644 --- a/Modules/Launcher/Plugins/ApplicationsPlugin.qml +++ b/Modules/Launcher/Plugins/ApplicationsPlugin.qml @@ -37,8 +37,8 @@ Item { if (!query || query.trim() === "") { // Return all apps alphabetically - return entries.sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase())) - .map(app => createResultEntry(app)) + return entries.sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase())).map( + app => createResultEntry(app)) } // Use fuzzy search if available, fallback to simple search diff --git a/Services/WallpaperService.qml b/Services/WallpaperService.qml index a81ae7b..897a9fd 100644 --- a/Services/WallpaperService.qml +++ b/Services/WallpaperService.qml @@ -256,11 +256,6 @@ Singleton { // Update cache directly currentWallpapers[screenName] = path - // Execute wallpaper change hook - if (HooksService) { - HooksService.executeWallpaperHook(path) - } - // Update Settings - still need immutable update for Settings persistence // The slice() ensures Settings detects the change and saves properly var monitors = Settings.data.wallpaper.monitors || [] @@ -291,6 +286,11 @@ Singleton { // Emit signal for this specific wallpaper change root.wallpaperChanged(screenName, path) + // Execute wallpaper change hook after the change is complete + if (HooksService) { + HooksService.executeWallpaperHook(path) + } + // Restart the random wallpaper timer if (randomWallpaperTimer.running) { randomWallpaperTimer.restart()