- hs->set_event_handler(LibHomeScreen::Event_TapShortcut, [wm](json_object *object) {
- qDebug("Surface %s got tapShortcut\n", myname.c_str());
- // Application should call LibWindowmanager::endDraw() in TapShortcut handler
- json_object *obj = json_object_new_object();
- json_object_object_add(obj, wm->kKeyDrawingName, json_object_new_string(myname.c_str()));
- json_object_object_add(obj, wm->kKeyDrawingArea, json_object_new_string("normal.full"));
- wm->activateSurface(obj);
+ hs->set_event_handler(LibHomeScreen::Event_ShowWindow, [hs, wm](json_object *object) {
+ qDebug("Surface %s got showWindow\n", myname.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(myname.c_str(), hs->_areaNormal);
+ else
+ wm->activateWindow(myname.c_str(), area);