From c591b49fbbe36c911d739edfb78ddc7d0de4100e Mon Sep 17 00:00:00 2001 From: Semun Lee Date: Tue, 5 Sep 2017 18:12:48 +0900 Subject: [PATCH] Render in pre resume callback forcefully PRE_RESUME assumes at least one render, so render forcefully in time tick callback. Change-Id: I58cb8be2b041d6eb70683b04b025442e67950942 Signed-off-by: Semun Lee Signed-off-by: Hyunho Kang --- src/watch_app_main.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/watch_app_main.c b/src/watch_app_main.c index b9c9315..e6ce778 100755 --- a/src/watch_app_main.c +++ b/src/watch_app_main.c @@ -161,6 +161,7 @@ static int __app_event_converter[APPCORE_BASE_EVENT_MAX] = { struct watch_app_context __context; static double __prev_target_tick = -1; +static Evas_Object *__watch_win; static void __on_ambient_tick(void *watchtime, void *data); static void __on_ambient_changed(int ambient, void *data); @@ -579,6 +580,30 @@ static int __on_pause(void *data) } /* LCOV_EXCL_STOP */ +static void __on_pre_resume(void *data) +{ + int w, h; + Ecore_Evas *ee; + struct _watch_time_s timeinfo = { + .timezone = NULL + }; + + __get_timeinfo(&timeinfo); + __on_time_tick(&timeinfo, data); + + if (timeinfo.timezone) + free(timeinfo.timezone); + + if (__watch_win == NULL) + return; + + ee = ecore_evas_ecore_evas_get(evas_object_evas_get(__watch_win)); + evas_output_viewport_get(ecore_evas_get(ee), NULL, NULL, &w, &h); + evas_obscured_clear(ecore_evas_get(ee)); + evas_damage_rectangle_add(ecore_evas_get(ee), 0, 0, w, h); + ecore_evas_manual_render(ee); +} + static int __on_resume(void *data) { _W("_watch_core_resume"); @@ -782,9 +807,8 @@ static int __viewer_state_handler(const char *widget_id, aul_app_com_result_e e, __on_pause(NULL); } else if (*state == AUL_SCREEN_STATUS_PRE_RESUME && __pre_resume_called == 0) { - __get_timeinfo(&timeinfo); _D("call pre resume tick"); - __on_time_tick(&timeinfo, NULL); + __on_pre_resume(NULL); __pre_resume_called = 1; } @@ -1155,6 +1179,9 @@ static void __win_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info char *plug_id; plug_id = evas_object_data_del(obj, "___PLUGID"); free(plug_id); + + if (__watch_win == obj) + __watch_win = NULL; } EXPORT_API int watch_app_get_elm_win(Evas_Object **win) @@ -1187,6 +1214,8 @@ EXPORT_API int watch_app_get_elm_win(Evas_Object **win) evas_object_event_callback_add(ret_win, EVAS_CALLBACK_DEL, __win_del_cb, NULL); *win = ret_win; + __watch_win = ret_win; + return APP_ERROR_NONE; } -- 2.7.4