notify: fix show animation signal emit logic 34/141634/3
authorJinYong Park <j4939.park@samsung.com>
Tue, 1 Aug 2017 07:27:18 +0000 (16:27 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Fri, 18 Aug 2017 07:21:08 +0000 (07:21 +0000)
Change-Id: Ia805528acfb3378af3cff68c249c1c86b8f55393
Signed-off-by: JinYong Park <j4939.park@samsung.com>
src/lib/elm_notify.c

index 1e646f68d58b80106475caf66fd041004cb9fdfb..5f70b9ae383e9d0a06b926a1ce12a1608aebad09 100644 (file)
 #define MY_CLASS_NAME "Elm_Notify"
 #define MY_CLASS_NAME_LEGACY "elm_notify"
 
+//TIZEN_ONLY(20170801): to manage show and animation state
+static void
+_notify_visuals_set(Evas_Object *obj)
+{
+   ELM_NOTIFY_DATA_GET(obj, sd);
+
+   if (sd->show_finished)
+   {
+      if (!sd->allow_events) elm_layout_signal_emit(sd->block_events, "elm,state,visible", "elm");
+      edje_object_signal_emit(sd->notify, "elm,state,visible", "elm");
+   }
+   else if (evas_object_visible_get(obj))
+   {
+       if (!sd->allow_events) elm_layout_signal_emit(sd->block_events, "elm,state,show,animation", "elm");
+       edje_object_signal_emit(sd->notify, "elm,state,show,animation", "elm");
+   }
+}
+//END
+
 static Elm_Theme_Apply
 _notify_theme_apply(Evas_Object *obj)
 {
@@ -165,16 +184,7 @@ _elm_notify_elm_widget_theme_apply(Eo *obj, Elm_Notify_Data *sd)
    _sizing_eval(obj);
 
    //TIZEN_ONLY(20161018): fix theme apply problem by font/language change
-   if (sd->show_finished)
-   {
-      elm_layout_signal_emit(sd->block_events, "elm,state,visible", "elm");
-      edje_object_signal_emit(sd->notify, "elm,state,visible", "elm");
-   }
-   else if (evas_object_visible_get(obj))
-   {
-       elm_layout_signal_emit(sd->block_events, "elm,state,show,animation", "elm");
-       edje_object_signal_emit(sd->notify, "elm,state,show,animation", "elm");
-   }
+   _notify_visuals_set(obj);
    //
    //TIZEN_ONLY(20170107): finish the hiding forcibly if get interrupt
    if (sd->hide_ongoing)
@@ -330,7 +340,7 @@ _elm_notify_evas_object_smart_show(Eo *obj, Elm_Notify_Data *sd)
         sd->hide_ongoing = EINA_FALSE;
         eo_do_super(obj, MY_CLASS, evas_obj_smart_hide());
         evas_object_hide(sd->notify);
-        if (sd->allow_events) evas_object_hide(sd->block_events);
+        if (!sd->allow_events) evas_object_hide(sd->block_events);
      }
    //
    eo_do_super(obj, MY_CLASS, evas_obj_smart_show());
@@ -365,7 +375,7 @@ _elm_notify_evas_object_smart_hide(Eo *obj, Elm_Notify_Data *sd)
      {
         eo_do_super(obj, MY_CLASS, evas_obj_smart_hide());
         evas_object_hide(sd->notify);
-        if (sd->allow_events) evas_object_hide(sd->block_events);
+        if (!sd->allow_events) evas_object_hide(sd->block_events);
      }
    ELM_SAFE_FREE(sd->timer, ecore_timer_del);
 }
@@ -763,8 +773,7 @@ _elm_notify_align_set(Eo *obj, Elm_Notify_Data *sd, double horizontal, double ve
    _calc(obj);
 
    /* TIZEN_ONLY(20170329): add signal emit after align set */
-   if (sd->show_finished)
-     edje_object_signal_emit(sd->notify, "elm,state,visible", "elm");
+   _notify_visuals_set(obj);
    /* END */
 }
 
@@ -775,7 +784,10 @@ _elm_notify_dismiss(Eo *obj EINA_UNUSED, Elm_Notify_Data *sd)
    if (sd->hide_ongoing) return;
    sd->hide_ongoing = EINA_TRUE;
    //
-   elm_layout_signal_emit(sd->block_events, "elm,state,hide", "elm");
+   //TIZEN_ONLY(20170801): block_events must be checked it is null or not null
+   //elm_layout_signal_emit(sd->block_events, "elm,state,hide", "elm");
+   if (!sd->allow_events) elm_layout_signal_emit(sd->block_events, "elm,state,hide", "elm");
+   //END
    edje_object_signal_emit(sd->notify, "elm,state,hide", "elm");
 
    /* TIZEN_ONLY(20170411): cancel timer when dismiss notify */