int (*resume) (void *); /**< Called when any window comes on top */
int (*terminate) (void *); /**< This callback function is called once after the main loop of application exits. */
void (*time_tick) (void *, void *);
+ void (*pre_resume) (void *, void *);
void (*ambient_tick) (void *, void *);
void (*ambient_changed) (int, void *);
void *reserved[6]; /**< Reserved */
&& __pre_resume_called == 0) {
__get_timeinfo(&timeinfo);
_D("call pre resume tick");
- priv.ops->time_tick(&timeinfo, priv.ops->data);
+ priv.ops->pre_resume(&timeinfo, priv.ops->data);
__pre_resume_called = 1;
}
static int _initialized = 0;
static int watch_core_initialized = 0;
+static Evas_Object *_watch_win;
+
struct app_event_handler {
app_event_type_e type;
app_event_cb cb;
time_tick_cb((watch_time_h)watchtime, app_context->data);
}
+static void _watch_core_pre_resume(void *watchtime, void *data)
+{
+ int w, h;
+ Ecore_Evas *ee;
+
+ _watch_core_time_tick(watchtime, data);
+
+ 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);
+}
+
/* LCOV_EXCL_START */
static void _watch_core_ambient_tick(void *watchtime, void *data)
{
.resume = _watch_core_resume,
.terminate = _watch_core_terminate,
.time_tick = _watch_core_time_tick,
+ .pre_resume = _watch_core_pre_resume,
.ambient_tick = _watch_core_ambient_tick,
.ambient_changed = _watch_core_ambient_changed,
};
{
char *plug_id;
plug_id = evas_object_data_del(obj, "___PLUGID");
+ if (_watch_win == obj)
+ _watch_win = NULL;
free(plug_id);
}
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;
}