summaryrefslogtreecommitdiffstats
path: root/sample/app/eventhandler.cpp
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2020-04-15 12:18:53 +0300
committerMarius Vlad <marius.vlad@collabora.com>2020-04-15 12:18:53 +0300
commite22bd28a5e1d11a8b608bd2a11b935ad5bcfc9b2 (patch)
tree926a7a04c4cb29f30b37c4a67c88e13c240aec23 /sample/app/eventhandler.cpp
parent3007e9ca8e0636e6a2a4e61eb113869bfcc1385b (diff)
sample/app: Allow to hang off data when activating the app
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Diffstat (limited to 'sample/app/eventhandler.cpp')
-rw-r--r--sample/app/eventhandler.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/sample/app/eventhandler.cpp b/sample/app/eventhandler.cpp
index 3a61887..b4b6a03 100644
--- a/sample/app/eventhandler.cpp
+++ b/sample/app/eventhandler.cpp
@@ -74,13 +74,24 @@ application_id_event(void *data, struct agl_shell_desktop *agl_shell_desktop,
return;
qInfo() << "app_id: " << app_id;
+}
- if (strcmp(app_id, "onescreenapp") == 0)
- emit ev_handler->signalOnReplyShowWindow(app_id);
+static void
+application_state_event(void *data, struct agl_shell_desktop *agl_shell_desktop,
+ const char *app_id, const char *app_data, uint32_t app_state, uint32_t app_role)
+{
+ /* unused */
+ (void) data;
+ (void) app_id;
+ (void) app_data;
+ (void) app_role;
+ (void) app_state;
+ (void) agl_shell_desktop;
}
static const struct agl_shell_desktop_listener agl_shell_desk_listener = {
application_id_event,
+ application_state_event,
};
static struct agl_shell_desktop *
@@ -202,7 +213,10 @@ void EventHandler::showWindow(QString id, QString json)
{
if (shell_desktop) {
struct wl_output *output = getWlOutput(qApp->screens().first());
- agl_shell_desktop_activate_app(shell_desktop, id.toStdString().c_str(), output);
+ agl_shell_desktop_activate_app(shell_desktop,
+ id.toStdString().c_str(),
+ json.toStdString().c_str(),
+ output);
}
qInfo() << "data from json: " << json.toStdString().c_str();