X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=sample%2Fsimple-egl%2Fsrc%2Fsimple-egl.cpp;h=aa6ea19762e732fccb706ff8a1d5e58cd55ddde1;hb=c0146077906057bf97688a617870228eaad0cf54;hp=4271a66139e9e7105a57e4c714a9e66f3fc08000;hpb=43452ff8a759da135525678528c159f1e4e68504;p=src%2Flibhomescreen.git diff --git a/sample/simple-egl/src/simple-egl.cpp b/sample/simple-egl/src/simple-egl.cpp index 4271a66..aa6ea19 100644 --- a/sample/simple-egl/src/simple-egl.cpp +++ b/sample/simple-egl/src/simple-egl.cpp @@ -569,9 +569,17 @@ init_hs(LibHomeScreen* hs){ return -1; } - hs->set_event_handler(LibHomeScreen::Event_TapShortcut, [](json_object *object){ - HMI_DEBUG("simple-egl","try to activesurface %s ", app_name.c_str()); - wm->activateWindow(main_role); + hs->set_event_handler(LibHomeScreen::Event_ShowWindow, [hs](json_object *object){ + HMI_DEBUG("simple-egl","try to activeWindow %s ", app_name.c_str()); + + struct json_object *param_obj = json_object_object_get(object, hs->_keyParameter); + const char *area = json_object_get_string( + json_object_object_get(param_obj, hs->_keyArea)); + // Application should call LibWindowmanager::activateWindow() in showWindow handler + if(area == nullptr) + wm->activateWindow(main_role, hs->_areaNormal); + else + wm->activateWindow(main_role, area); }); return 0;