Commit 379d162a authored by Fushan Wen's avatar Fushan Wen 💬 Committed by Marco Martin
Browse files

desktoppackage: fix unable to apply wallpaper settings after switching layout

`wallpaperGraphicsObject`, `wallpaper` or `wallpaperInterface`
is not set before calling `ContainmentInterface::loadWallpaper()`, so wait
until `wallpaperInterfaceChanged` signal is emitted. At that time
`applyWallpaper()` will call `syncWallpaperObjects()` to update
`wallpaperConfiguration`.

BUG: 407619
FIXED-IN: 5.24.6
parent 9a85ca90
Pipeline #190874 passed with stage
in 4 minutes and 40 seconds
......@@ -13,6 +13,7 @@ import QtQml 2.15
import org.kde.newstuff 1.62 as NewStuff
import org.kde.kirigami 2.5 as Kirigami
import org.kde.kcm 1.4
import org.kde.plasma.plasmoid 2.0
Item {
id: appearanceRoot
......@@ -36,6 +37,21 @@ Item {
configDialog.containmentPlugin = appearanceRoot.containmentPlugin
}
/*
* BUG 407619: `wallpaperGraphicsObject`, `wallpaper` or `wallpaperInterface`
* is not set before calling `ContainmentInterface::loadWallpaper()`, so wait
* until `wallpaperInterfaceChanged` signal is emitted. At that time
* `applyWallpaper()` will call `syncWallpaperObjects()` to update
* `wallpaperConfiguration`.
*/
Connections {
target: Plasmoid.self
function onWallpaperInterfaceChanged() {
configDialog.applyWallpaper();
main.loadSourceFile();
}
}
ColumnLayout {
width: root.availableWidth
height: Math.max(implicitHeight, root.availableHeight)
......@@ -161,11 +177,15 @@ Item {
// so we wouldn't load emptyConfig and break all over the place
// hence set it to some random value initially
property string sourceFile: "tbd"
onSourceFileChanged: {
if (sourceFile) {
onSourceFileChanged: loadSourceFile()
function loadSourceFile() {
const wallpaperConfig = configDialog.wallpaperConfiguration
// BUG 407619: wallpaperConfig can be null before calling `ContainmentInterface::loadWallpaper()`
if (wallpaperConfig && sourceFile) {
var props = {}
var wallpaperConfig = configDialog.wallpaperConfiguration
for (var key in wallpaperConfig) {
props["cfg_" + key] = wallpaperConfig[key]
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment