on xenial help sign in
don't switch apps in the middle of the animation... it breaks the animation
2eb12a3Michael Zanetti
qml/Stages/PhoneStage.qml+1−13
@@ -93,7 +93,6 @@ Item {
93 function switchToApp(appId) {
93 function switchToApp(appId) {
94 priv.newFocusedAppId = appId;
94 priv.newFocusedAppId = appId;
95 applicationSwitchingAnimation.start();
95 applicationSwitchingAnimation.start();
96− grantFocusTimer.start();
97 }
96 }
98
97
99 }
98 }
@@ -105,18 +104,6 @@ Item {
105 onScreenshotChanged: priv.focusedScreenshot = priv.focusedApplication.screenshot
104 onScreenshotChanged: priv.focusedScreenshot = priv.focusedApplication.screenshot
106 }
105 }
107
106
108− Timer {
109− id: grantFocusTimer
110− // Delay the actual switch to be covered by the animation for sure.
111− // 1) If we switch before starting the animation, the Mir event loop paints before the Qt event loop => flickering
112− // 2) If we do the switch after the animation, the panel wouldn't fade in early enough.
113− interval: UbuntuAnimation.SlowDuration / 4
114− repeat: false
115− onTriggered: {
116− ApplicationManager.focusApplication(priv.newFocusedAppId);
117− }
118− }
119−
120 Timer {
107 Timer {
121 id: appSplashTimer
108 id: appSplashTimer
122 // This is to show the splash screen a bit longer.
109 // This is to show the splash screen a bit longer.
@@ -152,6 +139,7 @@ Item {
152 }
139 }
153
140
154 // restore stuff
141 // restore stuff
142+ ScriptAction { script: ApplicationManager.focusApplication(priv.newFocusedAppId); }
155 PropertyAction { target: fadeInScreenshotImage; property: "visible"; value: false }
143 PropertyAction { target: fadeInScreenshotImage; property: "visible"; value: false }
156 PropertyAction { target: mainScreenshotImage; property: "visible"; value: false }
144 PropertyAction { target: mainScreenshotImage; property: "visible"; value: false }
157 }
145 }