@@ -39,6 +39,9 @@ Item {
39 readonly property int applicationState: root.application ? root.application.state : -1
39 readonly property int applicationState: root.application ? root.application.state : -1
40 readonly property var promptSurfaces: root.application ? root.application.promptSurfaces : null
40 readonly property var promptSurfaces: root.application ? root.application.promptSurfaces : null
42+ // Whether the Application had a surface before but lost it.
43+ property bool hadSurface: false
42 property bool needToTakeScreenshot:
45 property bool needToTakeScreenshot:
43 d.surface && d.surfaceInitialized && screenshotImage.status === Image.Null
46 d.surface && d.surfaceInitialized && screenshotImage.status === Image.Null
44 && d.applicationState === ApplicationInfo.Stopped
47 && d.applicationState === ApplicationInfo.Stopped
@@ -56,6 +59,7 @@ Item {
56 if (surface) {
59 if (surface) {
57 surfaceInitTimer.start();
60 surfaceInitTimer.start();
59 surfaceInitialized = false;
63 surfaceInitialized = false;
@@ -147,10 +151,17 @@ Item {
147 StateGroup {
151 StateGroup {
148 objectName: "applicationWindowStateGroup"
152 objectName: "applicationWindowStateGroup"
149 states: [
153 states: [
157+ d.hadSurface && (!d.surface || !d.surfaceInitialized)
159+ screenshotImage.status !== Image.Ready
151 name: "splashScreen"
162 name: "splashScreen"
153− (!d.surface || !d.surfaceInitialized)
164+ !d.hadSurface && (!d.surface || !d.surfaceInitialized)
155 screenshotImage.status !== Image.Ready
166 screenshotImage.status !== Image.Ready
@@ -225,6 +236,23 @@ Item {
225 PropertyAction { target: screenshotImage; property: "visible"; value: false }
236 PropertyAction { target: screenshotImage; property: "visible"; value: false }
226 PropertyAction { target: screenshotImage; property: "source"; value: "" }
237 PropertyAction { target: screenshotImage; property: "source"; value: "" }
241+ from: "surface"; to: "void"
242+ SequentialAnimation {
243+ PropertyAction { target: surfaceContainer; property: "visible"; value: false }
244+ ScriptAction { script: { if (d.surface) { d.surface.release(); } } }
248+ from: "void"; to: "surface"
249+ SequentialAnimation {
250+ PropertyAction { target: surfaceContainer; property: "opacity"; value: 0.0 }
251+ PropertyAction { target: surfaceContainer; property: "visible"; value: true }
252+ UbuntuNumberAnimation { target: surfaceContainer; property: "opacity";
254+ duration: UbuntuAnimation.BriskDuration }