From 13db32c880ca9ecc4fe230474330aef11c981f80 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Fri, 5 Aug 2022 19:56:29 +0300 Subject: homescreenhandler: Add support for split Signed-off-by: Marius Vlad Change-Id: I2d32a539e1f3bd5601c652b8fcf8888152258e07 --- homescreen/src/homescreenhandler.cpp | 15 +++++++++++++++ homescreen/src/homescreenhandler.h | 1 + homescreen/src/main.cpp | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/homescreen/src/homescreenhandler.cpp b/homescreen/src/homescreenhandler.cpp index c44cbb9..b1a99d8 100644 --- a/homescreen/src/homescreenhandler.cpp +++ b/homescreen/src/homescreenhandler.cpp @@ -54,6 +54,7 @@ void HomescreenHandler::init(void) */ connect(applaunch_iface, SIGNAL(started(QString)), this, SLOT(appStarted(QString))); connect(applaunch_iface, SIGNAL(terminated(QString)), this, SLOT(appTerminated(QString))); + connect(applaunch_iface, SIGNAL(splited(QString, uint32_t)), this, SLOT(appSplit(QString, uint32_t))); } @@ -110,6 +111,20 @@ void HomescreenHandler::addAppToStack(const QString& application_id) } } +void HomescreenHandler::appSplit(const QString& application_id, uint32_t orientation) +{ + struct agl_shell *agl_shell = aglShell->shell.get(); + QPlatformNativeInterface *native = qApp->platformNativeInterface(); + struct wl_output *output = getWlOutput(native, qApp->screens().first()); + + HMI_DEBUG("HomeScreen", "Split application %s", application_id.toStdString().c_str()); + + fprintf(stderr, "homescreen: doing a split for app %s with orientation passed %d\n", + application_id.toStdString().c_str(), orientation); + agl_shell_set_app_split(agl_shell, application_id.toStdString().c_str(), + orientation, output); +} + void HomescreenHandler::appStarted(const QString& application_id) { struct agl_shell *agl_shell = aglShell->shell.get(); diff --git a/homescreen/src/homescreenhandler.h b/homescreen/src/homescreenhandler.h index 503221a..a42acd7 100644 --- a/homescreen/src/homescreenhandler.h +++ b/homescreen/src/homescreenhandler.h @@ -57,6 +57,7 @@ signals: public slots: void appStarted(const QString& application_id); void appTerminated(const QString& application_id); + void appSplit(const QString& application_id, uint32_t orientation); private: ApplicationLauncher *mp_launcher; diff --git a/homescreen/src/main.cpp b/homescreen/src/main.cpp index c69a5be..e7549aa 100644 --- a/homescreen/src/main.cpp +++ b/homescreen/src/main.cpp @@ -114,7 +114,7 @@ global_add(void *data, struct wl_registry *reg, uint32_t name, if (strcmp(interface, agl_shell_interface.name) == 0) { shell_data->shell = static_cast( - wl_registry_bind(reg, name, &agl_shell_interface, 2)); + wl_registry_bind(reg, name, &agl_shell_interface, 3)); agl_shell_add_listener(shell_data->shell, &shell_listener, data); } -- cgit 1.2.3-korg