@@ -41,8 +41,8 @@ FocusScope {
4141 height: tablet ? units.gu(100) : units.gu(71)
4242
4343 property real edgeSize: units.gu(2)
44− property url default_background: shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg"
45− property url background: default_background
44+ property url defaultBackground: shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg"
45+ property url background: backgroundSettings.pictureUri
4646 readonly property real panelHeight: panel.panelHeight
4747
4848 property bool dashShown: dash.shown
@@ -118,40 +118,6 @@ FocusScope {
118118 schema.id: "org.gnome.desktop.background"
119119 }
120120
121− function updateImage() {
122− if (testImage.source == "")
123− return
124−
125− if (testImage.status == Image.Ready) {
126− if (shell.width / shell.height <= testImage.sourceSize.width / testImage.sourceSize.height) {
127− backgroundImage.sourceSize.width = 0
128− backgroundImage.sourceSize.height = Qt.binding(function() { return shell.height })
129− } else {
130− backgroundImage.sourceSize.height = 0
131− backgroundImage.sourceSize.width = Qt.binding(function() { return shell.width })
132− }
133−
134− shell.background = testImage.source
135− } else if (testImage.status == Image.Error) {
136− shell.background = shell.default_background
137− }
138−
139− // unload testImage source to save memory
140− testImage.source = ""
141− }
142−
143− Image {
144− id: testImage
145−
146− property url gsettingsImage: backgroundSettings.pictureUri
147−
148− source: gsettingsImage
149− visible: false
150−
151− onGsettingsImageChanged: source = gsettingsImage
152− onStatusChanged: updateImage()
153− }
154−
155121 VolumeControl {
156122 id: volumeControl
157123 }
@@ -173,11 +139,15 @@ FocusScope {
173139 || (stages.fullyShown && mainStage.usingScreenshots)
174140 || !stages.fullyShown && (mainStage.usingScreenshots || (sideStage.shown && sideStage.usingScreenshots)))
175141
176− Image {
142+ CrossFadeImage {
177143 id: backgroundImage
178144 source: shell.background
179145 anchors.fill: parent
180− fillMode: Image.PreserveAspectCrop
146+ onStatusChanged: {
147+ if (status == Image.Error) {
148+ backgroundSettings.pictureUri = shell.defaultBackground
149+ }
150+ }
181151 }
182152
183153 Rectangle {
@@ -476,7 +446,7 @@ FocusScope {
476446 onUnlocked: greeter.hide()
477447 onSelected: {
478448 var bgPath = greeter.model.data(uid, LightDM.UserRoles.BackgroundPathRole)
479− shell.background = bgPath ? bgPath : default_background
449+ shell.background = bgPath ? bgPath : defaultBackground
480450 }
481451
482452 onLeftTeaserPressedChanged: {