[Stage] also set pendingActivation when going to run focus animation
Turns out TLWM's pendingActivation is valid not only when launching a
new app, but also when any kind of window activation is going to happen.
This includes when an animation is going to play and focus the app after
that.
This commit add TLWM.pendingActivation() before playing focusAnimation
or rightEdgeFocusAnimaiton. This fixes the issue where a flick from
the right edge (switch to the most recent app) shows the wrong app for
a second.
In my opinion, I think pending activation is not the right way to solve
this kind of problem. However, implementing the proper fix will take
some time. So, in the meantime, this commit.
Fixes: https://github.com/ubports/ubuntu-touch/issues/1323
Suggested-by: Dalton Durst <dalton@ubports.com>
commit694e8a4a1eb25fe0b6c454c86d6fc69abdaa6d66
authorRatchanan Srirattanamet <ratchanan@ubports.com>
dateThu 19 Dec 2019, 19:59 (7 years ago)
parente0b46af
qml/Stage/Stage.qml+2
@@ -1209,6 +1209,7 @@ FocusScope {
12091209 to: 1
12101210 duration: UbuntuAnimation.SnapDuration
12111211 onStarted: {
1212+ topLevelSurfaceList.pendingActivation();
12121213 topLevelSurfaceList.raiseId(model.window.id);
12131214 }
12141215 onStopped: {
@@ -1222,6 +1223,7 @@ FocusScope {
12221223 UbuntuNumberAnimation { target: decoratedWindow; properties: "angle"; to: 0; duration: priv.animationDuration }
12231224 UbuntuNumberAnimation { target: decoratedWindow; properties: "itemScale"; to: 1; duration: priv.animationDuration }
12241225 onStarted: {
1226+ topLevelSurfaceList.pendingActivation();
12251227 inhibitSlideAnimation = true;
12261228 }
12271229 onStopped: {