Ecore_Event_Handler *pre_visibility;
Ecore_Event_Handler *visibility;
guint timer;
+ guint pause_timer;
bool started;
};
{
_W("Manual render timeout expired");
watch_manager_pause();
- watch_manager_notify_paused_status_of_viewer();
- __manual_render.timer = 0;
__manual_render_stop();
-
+ __manual_render.timer = 0;
return G_SOURCE_REMOVE;
}
-static void __manual_render_set_timer(void)
+static gboolean __pause_timeout_cb(gpointer data)
{
- if (__manual_render.timer)
- return;
+ if (elm_win_iconified_get(__win))
+ watch_manager_pause();
- __manual_render.timer = g_timeout_add(200, __manual_render_timeout_cb,
- NULL);
+ return G_SOURCE_REMOVE;
}
static void __manual_render_unset_timer(void)
__manual_render.timer = 0;
}
+static void __manual_render_set_timer(void)
+{
+ if (__manual_render.timer)
+ __manual_render_unset_timer();
+
+ __manual_render.timer = g_timeout_add(200, __manual_render_timeout_cb,
+ NULL);
+}
+
static void __manual_render_start(void)
{
if (!__watch_is_visible()) {
static void __aul_watch_control_cb(bundle *b, void *user_data)
{
- if (!__watch_is_visible())
- return;
+ bool v = __watch_is_visible();
+ bool i = elm_win_iconified_get(__win);
+ if (!v)
+ return;
__manual_render_start();
+ if (i) {
+ _D("Watch AppControl obj visibility[%d] win visibility[%d]", v, !i);
+ if (__manual_render.pause_timer)
+ g_source_remove(__manual_render.pause_timer);
+
+ __manual_render.pause_timer = g_timeout_add(200, __pause_timeout_cb,
+ NULL);
+ }
+}
+
+static gboolean __delay_resume_cb(gpointer data)
+{
+ watch_manager_resume();
+ return G_SOURCE_REMOVE;
}
static void __obj_move_cb(void *data, Evas *e, Evas_Object *obj,
void *event_info)
{
- if (!__watch_is_visible())
- return;
+ bool v = __watch_is_visible();
+ if (!v)
+ return;
__manual_render_start();
+ g_idle_add(__delay_resume_cb, NULL);
}
static Eina_Bool __window_on_pre_visibility(void *data, int type, void *event)
return ECORE_CALLBACK_RENEW;
}
-static Eina_Bool __window_on_visibility(void *data, int type, void *event)
-{
- Ecore_Wl2_Event_Window_Visibility_Change *ev = event;
- Ecore_Evas *ee;
- Ecore_Wl2_Window *wl_win;
- int win_id;
-
- if (!ev)
- return ECORE_CALLBACK_RENEW;
-
- ee = ecore_evas_ecore_evas_get(evas_object_evas_get(__win));
- if (!ee)
- return ECORE_CALLBACK_RENEW;
-
- wl_win = ecore_evas_wayland2_window_get(ee);
- if (!wl_win)
- return ECORE_CALLBACK_RENEW;
-
- win_id = ecore_wl2_window_id_get(wl_win);
- if (ev->win != win_id)
- return ECORE_CALLBACK_RENEW;
-
- if (!ev->fully_obscured) {
- LOGD("[__WINDOW_VISIBILITY_CHANGE__] win_id(%d)", ev->win);
- __manual_render_unset_timer();
- }
-
- return ECORE_CALLBACK_RENEW;
-}
static int __manual_render_init(void)
{
__window_on_pre_visibility, NULL);
if (!__manual_render.pre_visibility)
_W("Failed to add pre visibility change handler");
-
- __manual_render.visibility = ecore_event_handler_add(
- ECORE_WL2_EVENT_WINDOW_VISIBILITY_CHANGE,
- __window_on_visibility, NULL);
- if (!__manual_render.visibility)
- _W("Failed to add visibility change handler");
-
return 0;
}