diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2020-04-12 12:54:05 +0300 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2020-04-12 12:54:05 +0300 |
commit | 232d4b9e7116bc712f670676223183914246cfc0 (patch) | |
tree | 196de04edc6ee034f84aaac9fe14d4bfee1b8640 | |
parent | ce46bc880844a186d43c605362a6673322b0b104 (diff) |
Launcher: Make it more resilient
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
-rw-r--r-- | launcher/qml/Launcher.qml | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/launcher/qml/Launcher.qml b/launcher/qml/Launcher.qml index bd61af1..0c951fe 100644 --- a/launcher/qml/Launcher.qml +++ b/launcher/qml/Launcher.qml @@ -26,6 +26,7 @@ ApplicationWindow { height: container.height * container.scale property int pid: -1 + property string app_id: '' Item { id: container @@ -82,7 +83,9 @@ ApplicationWindow { repeat: false onTriggered: { - console.log("Should be able to see the the surface as the compositor will by default show it") + console.log("Activating app_id " + app_id) + shell.activate_app(Window.window, app_id) + app_id = '' } } @@ -101,11 +104,30 @@ ApplicationWindow { } if (currentId === '') { //homescreenHandler.tapShortcut(applicationModel.appid(loc.index)) - var app_id = applicationModel.appid(loc.index) - console.log("Trying to launch " + app_id) - homescreenHandler.launch(app_id) - timer_start_show.running = true + if (app_id === '') { + app_id = applicationModel.appid(loc.index) + console.log("Trying to launch " + app_id) + + if (pid === -1) { + console.log("pid is not set: " + pid) + pid = homescreenHandler.launch(app_id) + } else { + console.log("pid is already set: " + pid) + pid = homescreenHandler.launch(app_id) + } + + if (pid > 0) { + console.log("Activating timer to activate app " + app_id) + timer_start_show.running = true + } else { + app_id = '' + } + } else { + console.log("app_id is not empty = " + app_id) + app_id = '' + } } else { + console.log("Current_id is not empty!") currentId = '' } } |