From 6a1dd11989d25f1b24c6ac04e47eaa577d9f5f88 Mon Sep 17 00:00:00 2001 From: Hyunho Kang Date: Mon, 17 Jul 2017 14:21:40 +0900 Subject: [PATCH] Remove ECORE_WL_EVENT_WINDOW_SHOW handler Now widget framework can use ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE and ECORE_WL_EVENT_WINDOW_SHOW do not mean window is visible. So, let's make widget resume/pause event depend on ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE Change-Id: Iecad60c477e6f947a898265f9d1e046e51cea8e0 Signed-off-by: Hyunho Kang --- src/widget_app.c | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/src/widget_app.c b/src/widget_app.c index 3d3fc87..db42d0b 100755 --- a/src/widget_app.c +++ b/src/widget_app.c @@ -729,38 +729,6 @@ static void __destroy_all(int reason, int send_update) } } - -static Eina_Bool __show_cb(void *data, int type, void *event) -{ - Ecore_Wl_Event_Window_Show *ev = event; - widget_context_s *cxt = __find_context_by_win(ev->win); - - LOGD("show %d %d", (unsigned int)ev->win, (unsigned int)ev->data[0]); - - if (cxt) - __instance_resume(cxt->provider, cxt->id, UPDATE_ALL); - else - LOGE("unknown window error: %d", ev->win); /* LCOV_EXCL_LINE */ - - return ECORE_CALLBACK_RENEW; -} - -static Eina_Bool __hide_cb(void *data, int type, void *event) -{ - Ecore_Wl_Event_Window_Hide *ev = event; - widget_context_s *cxt = __find_context_by_win(ev->win); - - - LOGD("hide %d", (unsigned int)ev->win); - - if (cxt) - __instance_pause(cxt->provider, cxt->id, UPDATE_ALL); - else - LOGE("unknown window error: %d", ev->win); /* LCOV_EXCL_LINE */ - - return ECORE_CALLBACK_RENEW; -} - static Eina_Bool __visibility_cb(void *data, int type, void *event) { Ecore_Wl_Event_Window_Visibility_Change *ev = event; @@ -773,7 +741,8 @@ static Eina_Bool __visibility_cb(void *data, int type, void *event) return ECORE_CALLBACK_RENEW; } - if (cxt->state == WC_PAUSED && ev->fully_obscured == 0) { + if ((cxt->state == WC_READY || cxt->state == WC_PAUSED) + && ev->fully_obscured == 0) { __instance_resume(cxt->provider, cxt->id, UPDATE_ALL); } else if (cxt->state == WC_RUNNING && ev->fully_obscured == 1) { __instance_pause(cxt->provider, cxt->id, UPDATE_ALL); @@ -813,8 +782,6 @@ static Eina_Bool __configure_cb(void *data, int type, void *event) static void __add_climsg() { - ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_SHOW, __show_cb, NULL); - ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_HIDE, __hide_cb, NULL); ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE, __visibility_cb, NULL); ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_LOWER, __lower_cb, NULL); ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_CONFIGURE, __configure_cb, NULL); -- 2.7.4