Remove ECORE_WL_EVENT_WINDOW_SHOW handler 49/139049/2 accepted/tizen/3.0/common/20170719.081629 accepted/tizen/3.0/ivi/20170719.003727 accepted/tizen/3.0/mobile/20170719.003645 accepted/tizen/3.0/tv/20170719.003659 accepted/tizen/3.0/wearable/20170719.003713 submit/tizen_3.0/20170717.101133
authorHyunho Kang <hhstark.kang@samsung.com>
Mon, 17 Jul 2017 05:21:40 +0000 (14:21 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Mon, 17 Jul 2017 05:39:02 +0000 (14:39 +0900)
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 <hhstark.kang@samsung.com>
src/widget_app.c

index 3d3fc87..db42d0b 100755 (executable)
@@ -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);