X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=sample%2Ftemplate%2Fmain.cpp;h=fef270b282c0d461ca71a30215f4c7b7c18154dc;hb=43452ff8a759da135525678528c159f1e4e68504;hp=831df4130c6df0944b7c0439dd4af5a2168007d5;hpb=8bf11a8668902565b0e9a23e320777f5fb611848;p=src%2Flibhomescreen.git diff --git a/sample/template/main.cpp b/sample/template/main.cpp index 831df41..fef270b 100644 --- a/sample/template/main.cpp +++ b/sample/template/main.cpp @@ -146,16 +146,12 @@ int main(int argc, char *argv[]) // Set event handler hs->set_event_handler(LibHomeScreen::Event_TapShortcut, [wm](json_object *object) { - const char *appname = json_object_get_string( - json_object_object_get(object, "application_name")); - if(myname == appname) { - qDebug("Surface %s got tapShortcut\n", appname); - // 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(app_name.c_str())); - json_object_object_add(obj, wm->kKeyDrawingArea, json_object_new_string("normal.full")); - wm->activateSurface(obj); - } + 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); }); /*