notify: block_events restore previous style when style set failed
authorJinYong Park <j4939.park@samsung.com>
Thu, 1 Dec 2016 01:48:15 +0000 (10:48 +0900)
committerWonki Kim <wonki_.kim@samsung.com>
Mon, 2 Jan 2017 05:37:04 +0000 (14:37 +0900)
when call style_set to notify object, notify subobject try to elm_widget_theme.
But in that function, block_events try to check theme with previous style.

So, after try to wrong style set,
style set fuction don't return ELM_THEME_APPLY_SUCCESS with normal style
because block_events try to check previous wrong theme.

Change-Id: I262fcce721f59cc34c7fcfdf0ef452191c1cb88b
Signed-off-by: Jinyong Park <j4939.park@samsung.com>
src/lib/elm_notify.c

index 6ce0e06..f49a6d8 100644 (file)
@@ -102,9 +102,18 @@ _block_events_theme_apply(Evas_Object *obj)
 
    const char *style = elm_widget_style_get(obj);
 
+   /* TIZEN_ONLY(20161201): block_events restore previous style when style set failed
    if (!elm_layout_theme_set
        (sd->block_events, "notify", "block_events", style))
      CRI("Failed to set layout!");
+    */
+   const char *prev_style = elm_widget_style_get(sd->block_events);
+   Elm_Theme_Apply ret;
+
+   if (_elm_layout_theme_set_internal
+          (sd->block_events, "notify", "block_events", style) != ELM_THEME_APPLY_SUCCESS)
+     elm_layout_theme_set(sd->block_events, "notify", "block_events", prev_style);
+   /* END */
 }
 
 static void