aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2020-04-09 17:09:34 +0300
committerMarius Vlad <marius.vlad@collabora.com>2020-04-10 19:43:41 +0300
commit745f1d9e86e8cbd83c5ae84aba2513341da5ad7a (patch)
tree4e1b56f2ac78161fd3efb976c7409853a9146500
parent5030e956bc95325305ecfa0c2be55bfd47adcade (diff)
ShortcutArea: use the launcher to verify if the app is runningsandbox/mvlad/agl-compositor-old
Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ic583786b64a19bd5fd59a230d39dc4bc2cbe4603
-rw-r--r--homescreen/qml/ShortcutArea.qml14
-rw-r--r--homescreen/src/applicationlauncher.cpp6
-rw-r--r--homescreen/src/applicationlauncher.h1
3 files changed, 19 insertions, 2 deletions
diff --git a/homescreen/qml/ShortcutArea.qml b/homescreen/qml/ShortcutArea.qml
index a638d87..2bde841 100644
--- a/homescreen/qml/ShortcutArea.qml
+++ b/homescreen/qml/ShortcutArea.qml
@@ -54,18 +54,28 @@ Item {
property variant applications: {'' : -1}
+ function find_app_with_launcher(app_id) {
+ if (launcher.is_running(app_id))
+ return true
+
+ return false
+ }
+
function find_app(app, apps) {
for (var x in apps) {
if (apps[x] == -1)
continue
- if (x === app)
- return true
+ if (x === app) {
+ if (find_app_with_launcher(x))
+ return true
+ }
}
return false
}
+
function set_current_window_app(appid, window) {
current_appid = appid
current_window = window
diff --git a/homescreen/src/applicationlauncher.cpp b/homescreen/src/applicationlauncher.cpp
index cb9c9b3..917ecaf 100644
--- a/homescreen/src/applicationlauncher.cpp
+++ b/homescreen/src/applicationlauncher.cpp
@@ -65,6 +65,12 @@ int ApplicationLauncher::launch(const QString &application)
return result;
}
+bool ApplicationLauncher::is_running(const QString &application)
+{
+ if (m_launcher->connection_is_set())
+ return m_launcher->is_running(application);
+}
+
bool ApplicationLauncher::isLaunching() const
{
return m_launching;
diff --git a/homescreen/src/applicationlauncher.h b/homescreen/src/applicationlauncher.h
index e6ac183..10ea2ee 100644
--- a/homescreen/src/applicationlauncher.h
+++ b/homescreen/src/applicationlauncher.h
@@ -44,6 +44,7 @@ signals:
public slots:
int launch(const QString &application);
+ bool is_running(const QString &application);
void setCurrent(const QString &current);
private: