summaryrefslogtreecommitdiffstats
path: root/wayland/democompositor/qml
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2017-08-13 11:57:06 +0200
committerHolger Freyther <holger+qt@freyther.de>2017-09-12 06:17:11 +0000
commite9dc7f1db47f5b59d4bf85bc5c8971c2df1dc807 (patch)
tree35746f52c8edd4c1865a1689f351f6869a3b6769 /wayland/democompositor/qml
parent1b2ca45e95b06e81c0373f7055f31042edcd5530 (diff)
democompositor: Keep track of running apps and enforce singleton
Modify the ProcessLauncher to keep track of running apps in the m_appStates vector. Answer if an AppEntry has a AppState associated and use it to not launch a second instance of the application. In the future this could be an attribute of the .apps file. Change-Id: I19ed2840e0a64eb7f35fba0cb171e1c7fd722b06 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'wayland/democompositor/qml')
-rw-r--r--wayland/democompositor/qml/LaunchButton.qml5
1 files changed, 4 insertions, 1 deletions
diff --git a/wayland/democompositor/qml/LaunchButton.qml b/wayland/democompositor/qml/LaunchButton.qml
index 2d3801a..80a057a 100644
--- a/wayland/democompositor/qml/LaunchButton.qml
+++ b/wayland/democompositor/qml/LaunchButton.qml
@@ -57,5 +57,8 @@ MyButton {
text.maximumLineCount: 1
iconSize: 32
- onTriggered: launcher.launch(appEntry)
+ onTriggered: {
+ if (!launcher.isRunning(appEntry))
+ launcher.launch(appEntry)
+ }
}