@@ -109,9 +109,9 @@ Item {
109109 QtObject {
110110 id: priv
111111
112− readonly property string focusedAppId: ApplicationManager.focusedApplicationId
113− readonly property var focusedApplication: ApplicationManager.findApplication(focusedAppId)
114− readonly property url focusedScreenshot: focusedApplication ? focusedApplication.screenshot : ""
112+ property string focusedAppId: ApplicationManager.focusedApplicationId
113+ property var focusedApplication: ApplicationManager.findApplication(focusedAppId)
114+ property url focusedScreenshot: focusedApplication ? focusedApplication.screenshot : ""
115115
116116 property bool waitingForScreenshot: false
117117
@@ -123,7 +123,7 @@ Item {
123123 onFocusedScreenshotChanged: {
124124 if (root.moving && priv.waitingForScreenshot) {
125125 mainScreenshotImage.anchors.leftMargin = 0;
126− mainScreenshotImage.src = ApplicationManager.findApplication(ApplicationManager.focusedApplicationId).screenshot;
126+ mainScreenshotImage.src = priv.focusedScreenshot
127127 mainScreenshotImage.visible = true;
128128 } else if (priv.secondApplicationStarting && priv.waitingForScreenshot) {
129129 applicationSwitchingAnimation.start();
@@ -133,7 +133,7 @@ Item {
133133
134134 function requestNewScreenshot() {
135135 waitingForScreenshot = true;
136− ApplicationManager.updateScreenshot(ApplicationManager.focusedApplicationId);
136+ ApplicationManager.updateScreenshot(focusedAppId);
137137 }
138138
139139 function switchToApp(appId) {
@@ -154,7 +154,6 @@ Item {
154154 }
155155
156156 // FIXME: the signal connections seems to get lost.
157− // Check with Qt 5.2, see if we can remove this Connections and Binding objects
158157 Connections {
159158 target: priv.focusedApplication
160159 onScreenshotChanged: priv.focusedScreenshot = priv.focusedApplication.screenshot
@@ -183,11 +182,13 @@ Item {
183182 id: applicationSwitchingAnimation
184183 // setup
185184 PropertyAction { target: mainScreenshotImage; property: "anchors.leftMargin"; value: 0 }
186− // PropertyAction seems to fail when secondApplicationStarting and we didn't have another screenshot before
185+ // FIXME: PropertyAction seems to fail when secondApplicationStarting and we didn't have another screenshot before
187186 ScriptAction { script: mainScreenshotImage.src = priv.focusedScreenshot }
188− PropertyAction { target: mainScreenshotImage; property: "visible"; value: true }
189− PropertyAction { target: fadeInScreenshotImage; property: "source"; value: ApplicationManager.findApplication(priv.newFocusedAppId) ? ApplicationManager.findApplication(priv.newFocusedAppId).screenshot : "" }
190− PropertyAction { target: fadeInScreenshotImage; property: "visible"; value: true }
187+ PropertyAction { targets: [mainScreenshotImage, fadeInScreenshotImage]; property: "visible"; value: true }
188+ PropertyAction { target: fadeInScreenshotImage; property: "source"; value: {
189+ var newFocusedApp = ApplicationManager.findApplication(priv.newFocusedAppId);
190+ return newFocusedApp ? newFocusedApp.screenshot : "" }
191+ }
191192 PropertyAction { target: fadeInScreenshotImage; property: "opacity"; value: 0 }
192193 PropertyAction { target: fadeInScreenshotImage; property: "scale"; value: .8 }
193194
@@ -195,8 +196,7 @@ Item {
195196 // The actual animation
196197 ParallelAnimation {
197198 UbuntuNumberAnimation { target: mainScreenshotImage; property: "anchors.leftMargin"; to: root.width; duration: UbuntuAnimation.SlowDuration }
198− UbuntuNumberAnimation { target: fadeInScreenshotImage; property: "opacity"; to: 1; duration: UbuntuAnimation.SlowDuration }
199− UbuntuNumberAnimation { target: fadeInScreenshotImage; property: "scale"; to: 1; duration: UbuntuAnimation.SlowDuration }
199+ UbuntuNumberAnimation { target: fadeInScreenshotImage; properties: "opacity,scale"; to: 1; duration: UbuntuAnimation.SlowDuration }
200200 }
201201
202202 // restore stuff