summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-08-09 21:12:11 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-08-09 21:12:11 +0900
commitf01827e484c8c29f5fe9b482060b0c132a407e90 (patch)
treecfc4ea0a21496afb721656a08297038e4fcfd323
parentcc24ba7c7aea5a1a64c8847738bca113b3e2c5a1 (diff)
Change-Id: I9ae70f13e91f9444a215bec72ff9752ab6c334b5 Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
-rw-r--r--src/libwindowmanager.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libwindowmanager.cpp b/src/libwindowmanager.cpp
index 198c728..d2a442e 100644
--- a/src/libwindowmanager.cpp
+++ b/src/libwindowmanager.cpp
@@ -603,7 +603,7 @@ void LibWindowmanager::Impl::setActiveHandler(active_handler f) {
struct json_object* j = json_object_new_object();
json_object_object_add(j, "event", json_object_new_int(Event_Active));
struct json_object* j_i = json_object_new_object();
- json_object_object_add(j, "event", json_object_new_int(Event_Inactive));
+ json_object_object_add(j_i, "event", json_object_new_int(Event_Inactive));
int ret = afb_wsj1_call_j(this->wsj1, wmAPI, "wm_subscribe", j, _on_reply_static, this);
if (0 > ret) {
@@ -622,8 +622,7 @@ void LibWindowmanager::Impl::setVisibleHandler(visible_handler f) {
struct json_object* j = json_object_new_object();
json_object_object_add(j, "event", json_object_new_int(Event_Visible));
struct json_object* j_i = json_object_new_object();
- json_object_object_add(j, "event", json_object_new_int(Event_Invisible));
-
+ json_object_object_add(j_i, "event", json_object_new_int(Event_Invisible));
int ret = afb_wsj1_call_j(this->wsj1, wmAPI, "wm_subscribe", j, _on_reply_static, this);
if (0 > ret) {
HMI_ERROR("libwm", "Failed to subscribe event");
@@ -778,7 +777,6 @@ void LibWindowmanager::Impl::event(char const *et, json_object *object) {
HMI_ERROR("libwm", "Unknown event type string '%s'", et);
return;
}
-
json_object *j_val;
std::string role = "";
bool emit = false;
@@ -803,6 +801,7 @@ void LibWindowmanager::Impl::event(char const *et, json_object *object) {
case Event_Invisible : {
bool visible = ((oet.second == Event_Visible) ? true : false);
if(!emit) break;
+
if(_on_visible) {
return _on_visible(role.c_str(), visible);
}