Ecore_Event_Handler *hhide;
Ecore_Event_Handler *hvchange;
Ecore_Event_Handler *hlower;
+ Ecore_Event_Handler *hpvchange;
} appcore_ui_base_context;
return ECORE_CALLBACK_RENEW;
}
+static Eina_Bool __stub_pre_visibility_cb(void *data, int type, void *event)
+{
+ if (__context.ops.window.pre_visibility)
+ __context.ops.window.pre_visibility(type, event, __context.data);
+
+ return ECORE_CALLBACK_RENEW;
+}
+
static void __prepare_to_suspend(void)
{
int suspend = APPCORE_BASE_SUSPENDED_STATE_WILL_ENTER_SUSPEND;
__context.hvchange = ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE,
__stub_visibility_cb, NULL);
__context.hlower = ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_LOWER, __stub_lower_cb, NULL);
+ __context.hpvchange = ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_PRE_VISIBILITY_CHANGE,
+ __stub_pre_visibility_cb, NULL);
__context.state = AS_CREATED;
LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:create:done]", __context.appid);
}
+EXPORT_API void appcore_ui_base_window_on_pre_visibility(int type, void *event)
+{
+ Ecore_Wl_Event_Window_Pre_Visibility_Change *ev = event;
+ bool bvisibility;
+
+ if (ev && ev->type == ECORE_WL_WINDOW_VISIBILITY_TYPE_PRE_UNOBSCURED) {
+ __update_win((unsigned int)ev->win, 0, false);
+ bvisibility = __check_visible();
+
+ _DBG("bvisibility %d, b_active %d", bvisibility, b_active);
+ if (bvisibility && b_active == FALSE) {
+ _DBG(" Go to Resume state\n");
+ b_active = TRUE;
+ __do_resume();
+ }
+ }
+}
+
EXPORT_API int appcore_ui_base_init(appcore_ui_base_ops ops, int argc, char **argv,
void *data, unsigned int hint)
{
ecore_event_handler_del(__context.hvchange);
if (__context.hlower)
ecore_event_handler_del(__context.hlower);
+ if (__context.hpvchange)
+ ecore_event_handler_del(__context.hpvchange);
__finish_wl();
appcore_ui_base_window_on_visibility(type, event);
}
+static void __window_on_pre_visibility(int type, void *event, void *data)
+{
+ appcore_ui_base_window_on_pre_visibility(type, event);
+}
+
EXPORT_API appcore_ui_base_ops appcore_ui_base_get_default_ops(void)
{
appcore_ui_base_ops ops;
ops.window.hide = __window_on_hide;
ops.window.lower = __window_on_lower;
ops.window.visibility = __window_on_visibility;
+ ops.window.pre_visibility = __window_on_pre_visibility;
return ops;
}