@@ -142,6 +142,14 @@ Showable {
142142 }
143143 }
144144
145+ Timer {
146+ id: hideScreenshotsAfterBriefDelay
147+ // Since Mir & Qt have independent event loops, Mir often applies a focus request a frame later than when Qt
148+ // asks for it. To work around, delay removing the screenshots a touch so Mir has definitely shown the app.
149+ interval: 10
150+ onTriggered: stage.__hideScreenshots();
151+ }
152+
145153 function __hideScreenshots() {
146154 newApplicationScreenshot.clearApplication();
147155 oldApplicationScreenshot.clearApplication();
@@ -177,7 +185,7 @@ Showable {
177185 applicationManager.focusApplication(application);
178186 }
179187 if (!delayedHideScreenshots.running) {
180− stage.__hideScreenshots();
188+ hideScreenshotsAfterBriefDelay.start();
181189 }
182190 } else {
183191 /* FIXME: calling ApplicationManager::focusApplication does not focus
@@ -252,7 +260,7 @@ Showable {
252260 delayedHideScreenshots.start();
253261 } else {
254262 stage.focusedApplicationWhenUsingScreenshots = null;
255− stage.__hideScreenshots();
263+ hideScreenshotsAfterBriefDelay.start();
256264 }
257265 }
258266 }