X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fhomescreen.cpp;h=7b78c1a1a8b194a05affb081fcea651f6c8b5fac;hb=9f2e628c47c9bb431b3833cd4dd47ddc588d056c;hp=c02f62b1a53269569f989fc2fae17fb7beb00b4c;hpb=a7e49d93b4dd03f8ce3b77f831f9293ba5a3de01;p=apps%2Fagl-service-homescreen.git diff --git a/src/homescreen.cpp b/src/homescreen.cpp index c02f62b..7b78c1a 100644 --- a/src/homescreen.cpp +++ b/src/homescreen.cpp @@ -537,6 +537,13 @@ static int preinit(afb_api_t api) return 0; } +const char _wm_screenUpdated[] = "windowmanager/screenUpdated"; +static void callback(void *closure, const char *event, struct json_object *args, afb_api_t api) +{ + afb_api_verbose(api, 5, NULL, __LINE__, __FUNCTION__, "the handler received the event %s(%s)", + event, json_object_get_string(args)); +} + /** * homescreen binding init function * @@ -564,6 +571,10 @@ static int init(afb_api_t api) return -1; } + HS_WmProxy wm; + wm.subscribe(api, HS_WmProxy::Event_ScreenUpdated); + afb_api_event_handler_add(api, _wm_screenUpdated, callback, nullptr); + return g_hs_instance->init(api); }