elm_notify: finish the hiding forcibly if get interrupt 00/117200/2
authorMinkyu Kang <mk7.kang@samsung.com>
Sat, 7 Jan 2017 09:13:08 +0000 (18:13 +0900)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Tue, 28 Mar 2017 01:43:16 +0000 (18:43 -0700)
The notify was not hidden when following case
 - change the theme while hide is on going
 - show while hide is on going
 - hide finished calback is invoked hide is not on going

@tizen_fix

Change-Id: I1b194aac658fce0ea3514cc948eb2cabde23958a
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: jinwoo.shin <jw0227.shin@samsung.com>
src/lib/elm_notify.c
src/lib/elm_widget_notify.h

index ef7594e..0f660c0 100644 (file)
@@ -165,6 +165,10 @@ _elm_notify_elm_widget_theme_apply(Eo *obj, Elm_Notify_Data *sd)
        edje_object_signal_emit(sd->notify, "elm,state,show,animation", "elm");
    }
    //
+   //TIZEN_ONLY(20170107): finish the hiding forcibly if get interrupt
+   if (sd->hide_ongoing)
+     edje_object_signal_emit(sd->notify, "elm,action,hide,finished", "elm");
+   //
 
    return int_ret;
 }
@@ -277,6 +281,9 @@ _timer_cb(void *data)
    if ((hide_signal) && (!strcmp(hide_signal, "on")))
      {
         sd->in_timeout = EINA_TRUE;
+        //TIZEN_ONLY(20170107): finish the hiding forcibly if get interrupt
+        sd->hide_ongoing = EINA_TRUE;
+        //
         edje_object_signal_emit(sd->notify, "elm,state,hide", "elm");
      }
    else //for backport supporting: edc without emitting hide finished signal
@@ -305,6 +312,15 @@ _elm_notify_evas_object_smart_show(Eo *obj, Elm_Notify_Data *sd)
 {
    sd->had_hidden = EINA_FALSE;
    sd->in_timeout = EINA_FALSE;
+   //TIZEN_ONLY(20170107): finish the hiding forcibly if get interrupt
+   if (sd->hide_ongoing)
+     {
+        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);
+     }
+   //
    eo_do_super(obj, MY_CLASS, evas_obj_smart_show());
 
    evas_object_show(sd->notify);
@@ -325,7 +341,12 @@ _elm_notify_evas_object_smart_hide(Eo *obj, Elm_Notify_Data *sd)
    if ((hide_signal) && (!strcmp(hide_signal, "on")))
      {
         if (!sd->in_timeout)
-          edje_object_signal_emit(sd->notify, "elm,state,hide", "elm");
+          {
+             //TIZEN_ONLY(20170107): finish the hiding forcibly if get interrupt
+             sd->hide_ongoing = EINA_TRUE;
+             //
+             edje_object_signal_emit(sd->notify, "elm,state,hide", "elm");
+          }
      }
    else //for backport supporting: edc without emitting hide finished signal
      {
@@ -458,6 +479,11 @@ _hide_finished_cb(void *data,
                   const char *source EINA_UNUSED)
 {
    ELM_NOTIFY_DATA_GET(data, sd);
+
+   //TIZEN_ONLY(20170107): finish the hiding forcibly if get interrupt
+   if (!sd->hide_ongoing) return;
+   //
+
    sd->had_hidden = EINA_TRUE;
    evas_object_hide(sd->notify);
    if (!sd->allow_events) evas_object_hide(sd->block_events);
@@ -466,6 +492,9 @@ _hide_finished_cb(void *data,
    //TIZEN_ONLY(20161018): fix theme apply problem by font/language change
    sd->show_finished = EINA_FALSE;
    //
+   //TIZEN_ONLY(20170107): finish the hiding forcibly if get interrupt
+   sd->hide_ongoing = EINA_FALSE;
+   //
 }
 
 EOLIAN static void
@@ -479,6 +508,9 @@ _elm_notify_evas_object_smart_add(Eo *obj, Elm_Notify_Data *priv)
    //TIZEN_ONLY(20161018): fix theme apply problem by font/language change
    priv->show_finished = EINA_FALSE;
    //
+   //TIZEN_ONLY(20170107): finish the hiding forcibly if get interrupt
+   priv->hide_ongoing = EINA_FALSE;
+   //
 
    priv->notify = edje_object_add(evas_object_evas_get(obj));
    evas_object_smart_member_add(priv->notify, obj);
@@ -720,6 +752,9 @@ _elm_notify_align_set(Eo *obj, Elm_Notify_Data *sd, double horizontal, double ve
 EOLIAN static void
 _elm_notify_dismiss(Eo *obj EINA_UNUSED, Elm_Notify_Data *sd)
 {
+   //TIZEN_ONLY(20170107): finish the hiding forcibly if get interrupt
+   sd->hide_ongoing = EINA_TRUE;
+   //
    elm_layout_signal_emit(sd->block_events, "elm,state,hide", "elm");
    edje_object_signal_emit(sd->notify, "elm,state,hide", "elm");
 }
index 0eb1a89..e3a0dde 100644 (file)
@@ -41,6 +41,9 @@ struct _Elm_Notify_Data
    //TIZEN_ONLY(20161018): fix theme apply problem by font/language change
    Eina_Bool                show_finished;
    //
+   //TIZEN_ONLY(20170107): finish the hiding forcibly if get interrupt
+   Eina_Bool                hide_ongoing;
+   //
 };
 
 /**