From f01827e484c8c29f5fe9b482060b0c132a407e90 Mon Sep 17 00:00:00 2001 From: Kazumasa Mitsunari Date: Thu, 9 Aug 2018 21:12:11 +0900 Subject: Bug fix Change-Id: I9ae70f13e91f9444a215bec72ff9752ab6c334b5 Signed-off-by: Kazumasa Mitsunari --- src/libwindowmanager.cpp | 7 +++---- 1 file 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); } -- cgit 1.2.3-korg