From acc25222be03f335de2841bf8dd35a86e46ee667 Mon Sep 17 00:00:00 2001
From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Date: Thu, 31 Jul 2025 22:28:11 +0200
Subject: [PATCH] qml/Shell.qml: Dynamically switch gsettings context for
 backgroundPictureUri retrieval between com.lomiri.Shell and
 com.lomiri.Shell.Greeter.

This assures that bg image switching between session and lock screen
works as expected.

Signed-off-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
---
 qml/Shell.qml | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/qml/Shell.qml b/qml/Shell.qml
index 1b1ac54b3..55329be65 100644
--- a/qml/Shell.qml
+++ b/qml/Shell.qml
@@ -190,15 +190,24 @@ StyledItem {
 
         readonly property url defaultBackground: "file://" + Constants.defaultWallpaper
         readonly property bool hasCustomBackground: resolvedImage != defaultBackground
+        readonly property string gsettingsBackgroundPictureUri: ((shell.showingGreeter == true)
+                                                             ||  (shell.mode === "full-greeter")
+                                                             ||  (shell.mode === "greeter"))
+                                                              ? backgroundGreeterSettings.backgroundPictureUri
+                                                              : backgroundShellSettings.backgroundPictureUri
 
         GSettings {
-            id: backgroundSettings
-            schema.id: ((shell.showingGreeter == true) || (shell.mode === "full-greeter") || (shell.mode === "greeter")) ? "com.lomiri.Shell.Greeter" : "com.lomiri.Shell"
+            id: backgroundShellSettings
+            schema.id: "com.lomiri.Shell"
+        }
+        GSettings {
+            id: backgroundGreeterSettings
+            schema.id: "com.lomiri.Shell.Greeter"
         }
 
         candidates: [
             AccountsService.backgroundFile,
-            backgroundSettings.backgroundPictureUri,
+            gsettingsBackgroundPictureUri,
             defaultBackground
         ]
     }
-- 
2.47.2

