From e22bd28a5e1d11a8b608bd2a11b935ad5bcfc9b2 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Wed, 15 Apr 2020 12:18:53 +0300 Subject: [PATCH] sample/app: Allow to hang off data when activating the app Signed-off-by: Marius Vlad --- sample/app/eventhandler.cpp | 20 +++++++++++++++++--- sample/app/protocol/agl-shell-desktop.xml | 17 +++++++++++++++++ 2 files changed, 34 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(); diff --git a/sample/app/protocol/agl-shell-desktop.xml b/sample/app/protocol/agl-shell-desktop.xml index 6d53f92..05a3725 100644 --- a/sample/app/protocol/agl-shell-desktop.xml +++ b/sample/app/protocol/agl-shell-desktop.xml @@ -37,6 +37,11 @@ + + + + + The compositor may choose to advertise one or more application ids which @@ -58,6 +63,7 @@ description of app_id. + @@ -92,5 +98,16 @@ + + + + Notifies application(s) when other application have suffered state modifications. + + + + + + + -- 2.16.6