mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-03 02:51:46 +00:00
Init Sequence: removed a bunch of no longer necessary Settings.isLoaded
This commit is contained in:
@@ -13,7 +13,7 @@ Variants {
|
||||
|
||||
required property ShellScreen modelData
|
||||
|
||||
active: Settings.isLoaded && modelData && Settings.data.wallpaper.enabled
|
||||
active: modelData && Settings.data.wallpaper.enabled
|
||||
|
||||
sourceComponent: PanelWindow {
|
||||
id: root
|
||||
@@ -41,29 +41,10 @@ Variants {
|
||||
property string futureWallpaper: ""
|
||||
|
||||
// Fillmode default is "crop"
|
||||
property real fillMode: 1.0
|
||||
property real fillMode: WallpaperService.getFillModeUniform()
|
||||
property vector4d fillColor: Qt.vector4d(Settings.data.wallpaper.fillColor.r, Settings.data.wallpaper.fillColor.g, Settings.data.wallpaper.fillColor.b, 1.0)
|
||||
|
||||
// On startup, defer assigning wallpaper until the service cache is ready
|
||||
function _startWallpaperOnceReady() {
|
||||
if (!modelData) {
|
||||
Qt.callLater(_startWallpaperOnceReady)
|
||||
return
|
||||
}
|
||||
|
||||
var cacheReady = WallpaperService && WallpaperService.currentWallpapers && Object.keys(WallpaperService.currentWallpapers).length > 0
|
||||
if (!cacheReady) {
|
||||
// Try again on the next tick until WallpaperService.init() populates cache
|
||||
Qt.callLater(_startWallpaperOnceReady)
|
||||
return
|
||||
}
|
||||
|
||||
fillMode = WallpaperService.getFillModeUniform()
|
||||
var path = WallpaperService.getWallpaper(modelData.name)
|
||||
setWallpaperImmediate(path)
|
||||
}
|
||||
|
||||
Component.onCompleted: _startWallpaperOnceReady()
|
||||
Component.onCompleted: setWallpaperInitial()
|
||||
|
||||
Connections {
|
||||
target: Settings.data.wallpaper
|
||||
@@ -254,6 +235,16 @@ Variants {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function setWallpaperInitial() {
|
||||
// On startup, defer assigning wallpaper until the service cache is ready, retries every tick
|
||||
if (!WallpaperService || !WallpaperService.isInitialized) {
|
||||
Qt.callLater(setWallpaperInitial)
|
||||
return
|
||||
}
|
||||
|
||||
setWallpaperImmediate(WallpaperService.getWallpaper(modelData.name))
|
||||
}
|
||||
|
||||
function setWallpaperImmediate(source) {
|
||||
transitionAnimation.stop()
|
||||
@@ -324,4 +315,4 @@ Variants {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ Variants {
|
||||
delegate: Loader {
|
||||
required property ShellScreen modelData
|
||||
|
||||
active: Settings.isLoaded && CompositorService.isNiri && modelData && Settings.data.wallpaper.enabled
|
||||
active: CompositorService.isNiri && modelData && Settings.data.wallpaper.enabled
|
||||
|
||||
property string wallpaper: ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user