aboutsummaryrefslogtreecommitdiffstats
path: root/src/homescreen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/homescreen.cpp')
-rw-r--r--src/homescreen.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/homescreen.cpp b/src/homescreen.cpp
index 1caa23d..7457f88 100644
--- a/src/homescreen.cpp
+++ b/src/homescreen.cpp
@@ -72,6 +72,7 @@ int hs_handshake::hs_sts = hs_handshake::Handshake_Idle;
*/
void handshake_subscribe_callback(struct json_object *obj, const char *error, const char *info)
{
+ AFB_NOTICE("subscribe handshake reply: obj=%s, error=%s, info=%s", json_object_to_json_string(obj), error, info);
if(error == nullptr) {
hs_handshake::hs_sts = hs_handshake::Handshake_WaitEvent;
}
@@ -94,6 +95,7 @@ void handshake_subscribe_callback(struct json_object *obj, const char *error, co
*/
int on_handshake_event(afb_api_t api, const char *event, struct json_object *object)
{
+ AFB_NOTICE("received handshake event from windowmanager.");
hs_handshake::hs_sts = hs_handshake::Handshake_Over;
return 1;
}
@@ -112,6 +114,7 @@ int on_handshake_event(afb_api_t api, const char *event, struct json_object *obj
*/
int hs_handshake::start(afb_api_t api) const
{
+ AFB_NOTICE("start handshake with windowmanager.");
int ret = -1;
setEventHook(sub_event.c_str(), on_handshake_event);
int count = 0;
@@ -183,12 +186,12 @@ int hs_instance::init(afb_api_t api)
return -1;
}
- // const struct handshake_info *h = hs_config.getHandshakeInfo();
- // struct hs_handshake handshake(h->times, h->sleep);
- // if(handshake.start(api) < 0) {
- // AFB_ERROR("handshake with windowmanager failed.");
- // return -1;
- // }
+ const struct handshake_info *h = hs_config.getHandshakeInfo();
+ struct hs_handshake handshake(h->times, h->sleep);
+ if(handshake.start(api) < 0) {
+ AFB_ERROR("handshake with windowmanager failed.");
+ return -1;
+ }
if(app_recover == nullptr) {
AFB_ERROR("app_recover is nullptr.");