@@ -142,6 +142,14 @@ Showable {
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.
150+ onTriggered: stage.__hideScreenshots();
145 function __hideScreenshots() {
153 function __hideScreenshots() {
146 newApplicationScreenshot.clearApplication();
154 newApplicationScreenshot.clearApplication();
147 oldApplicationScreenshot.clearApplication();
155 oldApplicationScreenshot.clearApplication();
@@ -177,7 +185,7 @@ Showable {
177 applicationManager.focusApplication(application);
185 applicationManager.focusApplication(application);
179 if (!delayedHideScreenshots.running) {
187 if (!delayedHideScreenshots.running) {
180− stage.__hideScreenshots();
188+ hideScreenshotsAfterBriefDelay.start();
183 /* FIXME: calling ApplicationManager::focusApplication does not focus
191 /* FIXME: calling ApplicationManager::focusApplication does not focus
@@ -252,7 +260,7 @@ Showable {
252 delayedHideScreenshots.start();
260 delayedHideScreenshots.start();
254 stage.focusedApplicationWhenUsingScreenshots = null;
262 stage.focusedApplicationWhenUsingScreenshots = null;
255− stage.__hideScreenshots();
263+ hideScreenshotsAfterBriefDelay.start();