diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2020-04-15 19:59:11 +0300 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2020-04-15 19:59:11 +0300 |
commit | ff66bdf313d0695aa8042c3f707282fa68b0ead3 (patch) | |
tree | 356b737970517f003ecdd16e9cca38da93d0daf4 /sample/app | |
parent | e22bd28a5e1d11a8b608bd2a11b935ad5bcfc9b2 (diff) |
sample/app: Minor tweaks
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Diffstat (limited to 'sample/app')
-rw-r--r-- | sample/app/eventhandler.cpp | 1 | ||||
-rw-r--r-- | sample/app/main.qml | 35 |
2 files changed, 33 insertions, 3 deletions
diff --git a/sample/app/eventhandler.cpp b/sample/app/eventhandler.cpp index b4b6a03..17decc4 100644 --- a/sample/app/eventhandler.cpp +++ b/sample/app/eventhandler.cpp @@ -213,6 +213,7 @@ void EventHandler::showWindow(QString id, QString json) { if (shell_desktop) { struct wl_output *output = getWlOutput(qApp->screens().first()); + qInfo() << "sending activate_app"; agl_shell_desktop_activate_app(shell_desktop, id.toStdString().c_str(), json.toStdString().c_str(), diff --git a/sample/app/main.qml b/sample/app/main.qml index 2feab6d..609c637 100644 --- a/sample/app/main.qml +++ b/sample/app/main.qml @@ -22,6 +22,9 @@ ApplicationWindow { property int pid: -1 property bool onscreen_role_set: false + property string mapp_id: '' + property string mapp_data_msg: '' + Label { id: title width: parent.width @@ -318,6 +321,26 @@ ApplicationWindow { onsButton3 = qsTr("") } + Timer { + id: activate_timer + interval: 500 + running: false + repeat: false + onTriggered: { + console.log("calling eventHandler.showWindow for " + mapp_id + " and data msg " + mapp_data_msg) + eventHandler.showWindow(mapp_id, mapp_data_msg) + mapp_id = '' + mapp_data_msg = '' + } + } + + + function armTimer(app_id, msg) { + mapp_id = app_id + mapp_data_msg = msg + activate_timer.running = true + } + function postMessage() { console.log("poster pressed") btndata = "" @@ -354,11 +377,17 @@ ApplicationWindow { // we start we also display it using the default policy engine pid = eventHandler.start(onsId, postmsg) console.log("calling eventHandler.start for " + onsId + " with pid " + pid) + + // this is necessary jus the first time as we don't queue the + // 'activate_app' event and pass it over once onscreenapp is + // started. It is implementation detail in case it is required + console.log("calling armTimer for " + onsId) + armTimer(onsId, postmsg) } else { - // we just need to display it - console.log("calling eventHandler.showWindow for " + onsId) - eventHandler.showWindow(onsId, postmsg) + // onscreenapp is already start we just need to activate + pass the data + eventHandler.showWindow(mapp_id, mapp_data_msg) } + } function qmlOnReplyShowWindow(text) { |