elementary: make our tests work again
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Sat, 21 Sep 2019 11:10:53 +0000 (13:10 +0200)
committerJongmin Lee <jm105.lee@samsung.com>
Sun, 22 Sep 2019 21:11:58 +0000 (06:11 +0900)
73219114682f64fdbfe0809be3f2d991016dd3f1 moved the constructor to to
top, which leads to the fact that a few widgets cannot fetch the shared
data of the window. Which made the test suite fail.

With this commit we are just moving the sub_object_add after the
constructor, which fixes the flip crash.
This fixes the test suite

src/lib/elementary/efl_ui_widget.c

index 22af83e..5b19b0b 100644 (file)
@@ -5617,14 +5617,12 @@ _focus_event_changed(void *data EINA_UNUSED, const Efl_Event *event)
 EOLIAN static Eo *
 _efl_ui_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
 {
-   efl_canvas_group_clipped_set(obj, EINA_FALSE);
-   obj = efl_constructor(efl_super(obj, MY_CLASS));
+   Eo *parent = efl_parent_get(obj);
    sd->on_create = EINA_TRUE;
 
    sd->window = efl_provider_find(efl_parent_get(obj), EFL_UI_WIN_CLASS);
    if (!efl_isa(obj, EFL_UI_WIN_CLASS))
      {
-        Eo *parent = efl_parent_get(obj);
         if (!efl_isa(parent, EFL_UI_WIDGET_CLASS))
           {
              ERR("You passed a wrong parent parameter (%p %s). "
@@ -5635,7 +5633,6 @@ _efl_ui_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UN
           {
              ELM_WIDGET_DATA_GET(parent, parent_sd);
              sd->shared_win_data = parent_sd->shared_win_data;
-             efl_ui_widget_sub_object_add(parent, obj);
           }
      }
    else
@@ -5644,9 +5641,14 @@ _efl_ui_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UN
      }
 
    _efl_ui_focus_event_redirector(obj, obj);
+   efl_canvas_group_clipped_set(obj, EINA_FALSE);
+   obj = efl_constructor(efl_super(obj, MY_CLASS));
    efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
    evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
 
+   if (!efl_isa(obj, EFL_UI_WIN_CLASS) && efl_isa(parent, EFL_UI_WIDGET_CLASS))
+     efl_ui_widget_sub_object_add(parent, obj);
+
    sd->on_create = EINA_FALSE;
 
    efl_access_object_role_set(obj, EFL_ACCESS_ROLE_UNKNOWN);