on xenial help sign in
[spread] avoid changing sourceSize of snapshotted apps, it causes ghost apps in the spread

As the sourceSize of the screenshot Image was bound to its parent size, when the display rotated, it caused Qt to re-request the snapshot at the rotated dimensions. But as the application has been killed, no screenshot can be returned, resulting in ghost. Fixes: #1474319 Approved by: Michael Zanetti

commita5689f861c43ac2bef57abe82bc718ce9915bf69 authorGerry Boland <gerry.boland@canonical.com> dateMon 31 Aug 2015, 10:25 (11 years ago) parent868f568c00854d
1 file changed+5−4
qml/Stages/ApplicationWindow.qml+5−4
qml/Stages/ApplicationWindow.qml+5−4
@@ -95,15 +95,16 @@ FocusScope {
9595 antialiasing: !root.interactive
9696
9797 function take() {
98+ // Save memory by using a half-resolution (thus quarter size) screenshot.
99+ // Do not make this a binding, we can only take the screenshot once!
100+ sourceSize.width = root.width / 2;
101+ sourceSize.height = root.height / 2;
102+
98103 // Format: "image://application/$APP_ID/$CURRENT_TIME_MS"
99104 // eg: "image://application/calculator-app/123456"
100105 var timeMs = new Date().getTime();
101106 source = "image://application/" + root.application.appId + "/" + timeMs;
102107 }
103−
104− // Save memory by using a half-resolution (thus quarter size) screenshot
105− sourceSize.width: root.width / 2
106− sourceSize.height: root.height / 2
107108 }
108109
109110 Loader {