Wallpaper: delay service initialization until settings are ready

This commit is contained in:
LemmyCook
2025-08-29 12:41:37 -04:00
parent 7c6c908076
commit c37ef867a1
4 changed files with 12 additions and 17 deletions
+8 -10
View File
@@ -89,18 +89,16 @@ Singleton {
reload()
}
onLoaded: function () {
Qt.callLater(function () {
// Some stuff like settings validation should just be executed once on startup and not on every reload
if (!isLoaded) {
Logger.log("Settings", "JSON completed loading")
if (!isLoaded) {
Logger.log("Settings", "----------------------------")
Logger.log("Settings", "Settings loaded successfully")
isLoaded = true
// Validate monitor configurations, only once
// if none of the configured monitors exist, clear the lists
Qt.callLater(function () {
// Some stuff like settings validation should just be executed once on startup and not on every reload
validateMonitorConfigurations()
isLoaded = true
}
})
})
}
}
onLoadFailed: function (error) {
if (error.toString().includes("No such file") || error === 2)
+2 -3
View File
@@ -10,9 +10,8 @@ Variants {
delegate: Loader {
required property ShellScreen modelData
property string wallpaperSource: WallpaperService.getWallpaper(modelData.name)
active: wallpaperSource !== ""
active: Settings.isLoaded && WallpaperService.getWallpaper(modelData.name)
sourceComponent: PanelWindow {
@@ -32,7 +31,7 @@ Variants {
Image {
anchors.fill: parent
fillMode: Image.PreserveAspectCrop
source: wallpaperSource
source: WallpaperService.getWallpaper(modelData.name)
cache: true
smooth: true
mipmap: false
+2 -3
View File
@@ -11,9 +11,8 @@ Variants {
delegate: Loader {
required property ShellScreen modelData
property string wallpaperSource: WallpaperService.getWallpaper(modelData.name)
active: CompositorService.isNiri && wallpaperSource !== ""
active: Settings.isLoaded && CompositorService.isNiri
sourceComponent: PanelWindow {
Component.onCompleted: {
@@ -37,7 +36,7 @@ Variants {
id: bgImage
anchors.fill: parent
fillMode: Image.PreserveAspectCrop
source: wallpaperSource
source: WallpaperService.getWallpaper(modelData.name)
cache: true
smooth: true
mipmap: false
-1
View File
@@ -22,7 +22,6 @@ Singleton {
// Ensure cache dir exists
Quickshell.execDetached(["mkdir", "-p", Settings.cacheDir])
// TODO: fix matugen
var content = buildConfigToml()
var mode = Settings.data.colorSchemes.darkMode ? "dark" : "light"