From: Jan-Simon Moeller Date: Thu, 20 Dec 2018 19:47:50 +0000 (+0000) Subject: Merge "Use Event_ShowWindow instead of Event_TapShortcut" X-Git-Tag: 6.99.3^0 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=staging%2Fxdg-launcher.git;a=commitdiff_plain;h=da4fc1efac827ac209c4d7c83968e0433c681298;hp=93a5d6fef6e1ed01ed722d1110ad362369335f17 Merge "Use Event_ShowWindow instead of Event_TapShortcut" --- diff --git a/CMakeLists.txt b/CMakeLists.txt index af5e6b7..f88ffbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,7 @@ find_package(PkgConfig REQUIRED) pkg_check_modules(GLIB REQUIRED glib-2.0) pkg_check_modules(GIO REQUIRED gio-2.0) pkg_check_modules(ILMCONTROL REQUIRED ilmControl) +pkg_check_modules(ILMINPUT REQUIRED ilmInput) # No configuration # configure_file ( @@ -22,6 +23,7 @@ pkg_check_modules(ILMCONTROL REQUIRED ilmControl) include_directories( "include" "${ILMCONTROL_INCLUDE_DIRS}" + "${ILMINPUT_INCLUDE_DIRS}" "${GLIB_INCLUDE_DIRS}" "${GIO_INCLUDE_DIRS}" ) @@ -34,6 +36,7 @@ SET(LIBRARIES windowmanager homescreen ${ILMCONTROL_LIBRARIES} + ${ILMINPUT_LIBRARIES} afbwsc json-c pthread @@ -54,14 +57,10 @@ add_custom_target(widget # simple egl COMMAND wgtpkg-pack -f -o ${PROJECT_BINARY_DIR}/package/simple-egl.wgt ${PROJECT_BINARY_DIR}/package/simple-egl # override hvac to test runxdg - COMMAND wgtpkg-pack -f -o ${PROJECT_BINARY_DIR}/package/hvac.wgt ${PROJECT_BINARY_DIR}/package/hvac - # override navigation to test runxdg - COMMAND wgtpkg-pack -f -o ${PROJECT_BINARY_DIR}/package/navi.wgt ${PROJECT_BINARY_DIR}/package/navi - - # test for video - COMMAND wgtpkg-pack -f -o ${PROJECT_BINARY_DIR}/package/video.wgt ${PROJECT_BINARY_DIR}/package/video # test for webbrowser COMMAND wgtpkg-pack -f -o ${PROJECT_BINARY_DIR}/package/webbrowser.wgt ${PROJECT_BINARY_DIR}/package/webbrowser + # test for lifecycle + COMMAND wgtpkg-pack -f -o ${PROJECT_BINARY_DIR}/package/lifecycle.wgt ${PROJECT_BINARY_DIR}/package/lifecycle ) diff --git a/package/hvac/icon.svg b/package/hvac/icon.svg deleted file mode 100644 index 67918e6..0000000 --- a/package/hvac/icon.svg +++ /dev/null @@ -1,349 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/package/hvac/runxdg.toml b/package/hvac/runxdg.toml deleted file mode 100644 index 48a0ee3..0000000 --- a/package/hvac/runxdg.toml +++ /dev/null @@ -1,22 +0,0 @@ -[application] -# role: identifier for WindowManager (used in layers.json) -# e.g. role = "WebBrowser" -role = "HVAC" - -# launch by "POSIX"(fork/exec), "AFM_DBUS"(afm via dbus), "AFM_WEBSOCKET"(afm via websockt) -method = "POSIX" - -# path: path to the executable -# e.g. -# path = "/usr/bin/chromium" -path = "/usr/bin/weston-simple-egl" - -# params: arguments of the excecutable -# e.g. -# params = [ -# "--mus", -# "--no-sandbox", -# "--window-size=1080,1488", -# "--ozone-platform=wayland", -# "" -# ] diff --git a/package/hvac/bin/runxdg b/package/lifecycle/bin/runxdg similarity index 100% rename from package/hvac/bin/runxdg rename to package/lifecycle/bin/runxdg diff --git a/package/hvac/config.xml b/package/lifecycle/config.xml similarity index 66% rename from package/hvac/config.xml rename to package/lifecycle/config.xml index d6722bd..3006fd0 100644 --- a/package/hvac/config.xml +++ b/package/lifecycle/config.xml @@ -1,9 +1,9 @@ - - HVAC + + Test For LifeCycle - Launcher for XDG application on AGL HomeScreen 2017 + Test program for AGL LifeCycle Management Panasonic Corporation MIT @@ -12,6 +12,5 @@ - diff --git a/package/lifecycle/icon.svg b/package/lifecycle/icon.svg new file mode 100644 index 0000000..882e3c4 --- /dev/null +++ b/package/lifecycle/icon.svg @@ -0,0 +1,114 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/package/video/runxdg.toml b/package/lifecycle/runxdg.toml similarity index 96% rename from package/video/runxdg.toml rename to package/lifecycle/runxdg.toml index 9bcea9c..3abd014 100644 --- a/package/video/runxdg.toml +++ b/package/lifecycle/runxdg.toml @@ -1,7 +1,7 @@ [application] # role: identifier for WindowManager (used in layers.json) # e.g. role = "WebBrowser" -role = "Video" +role = "runxdg" # launch by "POSIX"(fork/exec), "AFM_DBUS"(afm via dbus), "AFM_WEBSOCKET"(afm via websockt) method = "POSIX" diff --git a/package/navi/bin/runxdg b/package/navi/bin/runxdg deleted file mode 100755 index dac903c..0000000 --- a/package/navi/bin/runxdg +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec /usr/bin/runxdg $@ diff --git a/package/navi/config.xml b/package/navi/config.xml deleted file mode 100644 index 97c921b..0000000 --- a/package/navi/config.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - Navigation - - - Launcher for XDG application on AGL HomeScreen 2017 - Panasonic Corporation - MIT - - - - - - - - - diff --git a/package/navi/icon.svg b/package/navi/icon.svg deleted file mode 100644 index 97fcf31..0000000 --- a/package/navi/icon.svg +++ /dev/null @@ -1,183 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/package/navi/runxdg.toml b/package/navi/runxdg.toml deleted file mode 100644 index 1af18e8..0000000 --- a/package/navi/runxdg.toml +++ /dev/null @@ -1,22 +0,0 @@ -[application] -# role: identifier for WindowManager (used in layers.json) -# e.g. role = "WebBrowser" -role = "Navigation" - -# launch by "POSIX"(fork/exec), "AFM_DBUS"(afm via dbus), "AFM_WEBSOCKET"(afm via websockt) -method = "POSIX" - -# path: path to the executable -# e.g. -# path = "/usr/bin/chromium" -path = "/usr/bin/weston-simple-egl" - -# params: arguments of the excecutable -# e.g. -# params = [ -# "--mus", -# "--no-sandbox", -# "--window-size=1080,1488", -# "--ozone-platform=wayland", -# "" -# ] diff --git a/package/simple-egl/config.xml b/package/simple-egl/config.xml index dbf701a..ee3ce66 100644 --- a/package/simple-egl/config.xml +++ b/package/simple-egl/config.xml @@ -1,5 +1,5 @@ - + SimpleEGL diff --git a/package/simple-egl/runxdg.toml b/package/simple-egl/runxdg.toml index 0bba232..3abd014 100644 --- a/package/simple-egl/runxdg.toml +++ b/package/simple-egl/runxdg.toml @@ -1,7 +1,7 @@ [application] # role: identifier for WindowManager (used in layers.json) # e.g. role = "WebBrowser" -role = "SimpleEGL" +role = "runxdg" # launch by "POSIX"(fork/exec), "AFM_DBUS"(afm via dbus), "AFM_WEBSOCKET"(afm via websockt) method = "POSIX" diff --git a/package/video/bin/runxdg b/package/video/bin/runxdg deleted file mode 100755 index dac903c..0000000 --- a/package/video/bin/runxdg +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec /usr/bin/runxdg $@ diff --git a/package/video/config.xml b/package/video/config.xml deleted file mode 100644 index 3aa9332..0000000 --- a/package/video/config.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - Video - - - This is a demo application for video player - Tasuku Suzuki <tasuku.suzuki@qt.io> - APL 2.0 - - - - - - - - diff --git a/package/video/icon.svg b/package/video/icon.svg deleted file mode 100644 index 905d46f..0000000 --- a/package/video/icon.svg +++ /dev/null @@ -1,111 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/package/webbrowser/config.xml b/package/webbrowser/config.xml index 68cab15..976bebf 100644 --- a/package/webbrowser/config.xml +++ b/package/webbrowser/config.xml @@ -4,7 +4,7 @@ Web Browser (Chromium) - IoT.bzh + Panasonic MIT diff --git a/package/webbrowser/runxdg.toml b/package/webbrowser/runxdg.toml index ed275e4..3f167e4 100644 --- a/package/webbrowser/runxdg.toml +++ b/package/webbrowser/runxdg.toml @@ -1,7 +1,7 @@ [application] # role: identifier for WindowManager (used in layers.json) # e.g. role = "WebBrowser" -role = "WebBrowser" +role = "webbrowser" # launch by "POSIX"(fork/exec), "AFM_DBUS"(afm via dbus), "AFM_WEBSOCKET"(afm via websockt) method = "POSIX" @@ -9,7 +9,7 @@ method = "POSIX" # path: path to the executable # e.g. # path = "/usr/bin/chromium" -path = "/usr/bin/weston-simple-egl" +path = "/usr/bin/chromium" # params: arguments of the excecutable # e.g. @@ -20,3 +20,12 @@ path = "/usr/bin/weston-simple-egl" # "--ozone-platform=wayland", # "" # ] +params = [ + "--mus", + "--no-sandbox", + "--single-process", + "--window-size=1080,1488", + "--ozone-platform=wayland", + "--touch-events=enabled", + "https://maps.google.com/maps" +] diff --git a/src/runxdg.cpp b/src/runxdg.cpp index 30a11e4..8582023 100644 --- a/src/runxdg.cpp +++ b/src/runxdg.cpp @@ -84,7 +84,8 @@ void RunXDG::notify_ivi_control_cb (ilmObjectType object, t_ilm_uint id, m_launcher->register_surfpid(surf_pid); if (m_launcher->m_rid && surf_pid == m_launcher->find_surfpid_by_rid(m_launcher->m_rid)) { - setup_surface(id); + m_ivi_id = id; + setup_surface(); } m_surfaces[surf_pid] = id; } else if (object == ILM_LAYER) { @@ -280,12 +281,16 @@ int RunXDG::init_wm (void) return -1; } - std::function< void(json_object*) > h_active = [](json_object* object) { + std::function< void(json_object*) > h_active = [this](json_object* object) { AGL_DEBUG("Got Event_Active"); + t_ilm_surface s_ids[1] = { this->m_ivi_id }; + ilm_setInputFocus(s_ids, 1, ILM_INPUT_DEVICE_KEYBOARD, ILM_TRUE); }; - std::function< void(json_object*) > h_inactive = [](json_object* object) { + std::function< void(json_object*) > h_inactive = [this](json_object* object) { AGL_DEBUG("Got Event_Inactive"); + t_ilm_surface s_ids[1] = { this->m_ivi_id }; + ilm_setInputFocus(s_ids, 1, ILM_INPUT_DEVICE_KEYBOARD, ILM_FALSE); }; std::function< void(json_object*) > h_visible = [](json_object* object) { @@ -451,13 +456,13 @@ RunXDG::RunXDG (int port, const char* token, const char* id) AGL_DEBUG("RunXDG created."); } -void RunXDG::setup_surface (int id) +void RunXDG::setup_surface (void) { - std::string sid = std::to_string(id); + std::string sid = std::to_string(m_ivi_id); // This surface is mine, register pair app_name and ivi id. - AGL_DEBUG("requestSurfaceXDG(%s,%d)", m_role.c_str(), id); - m_wm->requestSurfaceXDG(this->m_role.c_str(), id); + AGL_DEBUG("requestSurfaceXDG(%s,%d)", m_role.c_str(), m_ivi_id); + m_wm->requestSurfaceXDG(this->m_role.c_str(), (unsigned int)m_ivi_id); if (m_pending_create) { // Recovering 1st time tap_shortcut is dropped because @@ -556,6 +561,8 @@ void RunXDG::start (void) AGL_DEBUG("waiting for notification: surafce created"); m_pending_create = true; + ilm_commitChanges(); + // in case, target app has already run if (m_launcher->m_rid) { pid_t surf_pid = m_launcher->find_surfpid_by_rid(m_launcher->m_rid); @@ -567,10 +574,13 @@ void RunXDG::start (void) int id = itr->second; AGL_DEBUG("surface %d for <%s> already exists", id, m_role.c_str()); - setup_surface(id); + m_ivi_id = id; + setup_surface(); } } } + + ilm_commitChanges(); m_launcher->loop(e_flag); } diff --git a/src/runxdg.hpp b/src/runxdg.hpp index ce0c016..595babe 100644 --- a/src/runxdg.hpp +++ b/src/runxdg.hpp @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -149,6 +150,8 @@ class RunXDG LibHomeScreen *m_hs; ILMControl *m_ic; + t_ilm_surface m_ivi_id; + std::map m_surfaces; // pair of bool m_pending_create = false; @@ -158,7 +161,7 @@ class RunXDG int parse_config(const char *file); - void setup_surface(int id); + void setup_surface(void); }; #endif // RUNXDG_HPP