Code Review
/
staging
/
xdg-launcher.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add example:weston-terminal
[staging/xdg-launcher.git]
/
src
/
runxdg.cpp
diff --git
a/src/runxdg.cpp
b/src/runxdg.cpp
index
3ff942c
..
1ce3881
100644
(file)
--- a/
src/runxdg.cpp
+++ b/
src/runxdg.cpp
@@
-83,7
+83,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)) {
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) {
}
m_surfaces[surf_pid] = id;
} else if (object == ILM_LAYER) {
@@
-279,12
+280,16
@@
int RunXDG::init_wm (void)
return -1;
}
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");
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");
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) {
};
std::function< void(json_object*) > h_visible = [](json_object* object) {
@@
-332,9
+337,13
@@
int RunXDG::init_hs (void)
if (json_object_object_get_ex(object, "application_name", &val)) {
const char *name = json_object_get_string(val);
if (json_object_object_get_ex(object, "application_name", &val)) {
const char *name = json_object_get_string(val);
- AGL_DEBUG("Event_TapShortcut <%s>", name);
+ const char *app_id = this->m_id.c_str();
+ int len = strlen(name);
- if (strcmp(name, this->m_role.c_str()) == 0) {
+ AGL_DEBUG("Event_TapShortcut <appid=%s,%s,%d>", name, app_id, len);
+
+ if (strcmp(name, app_id) == 0 ||
+ (strncmp(name, app_id, len) == 0 && ('@' == app_id[len]))) {
// check app exist and re-launch if needed
AGL_DEBUG("Activesurface %s ", this->m_role.c_str());
// check app exist and re-launch if needed
AGL_DEBUG("Activesurface %s ", this->m_role.c_str());
@@
-454,7
+463,7
@@
RunXDG::RunXDG (int port, const char* token, const char* id)
AGL_FATAL("Error in config");
}
AGL_FATAL("Error in config");
}
- AGL_DEBUG("id=[%s],
nam
e=[%s], path=[%s], port=%lu, token=[%s]",
+ AGL_DEBUG("id=[%s],
rol
e=[%s], path=[%s], port=%lu, token=[%s]",
m_id.c_str(), m_role.c_str(), m_path.c_str(),
m_port, m_token.c_str());
m_id.c_str(), m_role.c_str(), m_path.c_str(),
m_port, m_token.c_str());
@@
-471,9
+480,9
@@
RunXDG::RunXDG (int port, const char* token, const char* id)
AGL_DEBUG("RunXDG created.");
}
AGL_DEBUG("RunXDG created.");
}
-void RunXDG::setup_surface (
int
id)
+void RunXDG::setup_surface (
vo
id)
{
{
- 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.
json_object *obj = json_object_new_object();
// This surface is mine, register pair app_name and ivi id.
json_object *obj = json_object_new_object();
@@
-599,7
+608,8
@@
void RunXDG::start (void)
int id = itr->second;
AGL_DEBUG("surface %d for <%s> already exists", id,
m_role.c_str());
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();
}
}
}
}
}
}