on xenial help sign in
[Launcher] fix apps launched from panel appears in background sometimes

When Shell receives launcherApplicationSelected(), it'll tell TopLevel WindowModel that an activation might be pending to prevents giving focus to the previously focused window when the shell is unfocused. In order to benefit from this, Launcher has to signal selection _before_ unfocus itself. The drawer case has its order correct. However, the panel case has its order swapped, causing TLWM to give the focus to the previously focused app. So, this commit swap the order, fixing it. The reason it happened only when the drawer is opened is that opening only the panel doesn't change the focus. So, there's no re-focus. Fixes: https://github.com/ubports/ubuntu-touch/issues/1210

commite0b46af726034b4acaf3fe2ab43bd59d3c9a292c authorRatchanan Srirattanamet <ratchanan@ubports.com> dateTue 17 Dec 2019, 20:43 (7 years ago) parent8762b72
1 file changed+1−1
qml/Launcher/Launcher.qml+1−1
qml/Launcher/Launcher.qml+1−1
@@ -419,8 +419,8 @@ FocusScope {
419419 property bool animate: true
420420
421421 onApplicationSelected: {
422+ launcherApplicationSelected(appId);
422423 root.hide(ignoreHideIfMouseOverLauncher);
423− launcherApplicationSelected(appId)
424424 }
425425 onShowDashHome: {
426426 root.hide(ignoreHideIfMouseOverLauncher);