elementary: make sure windows are not born orfan and properly have at least a main...
authorCedric Bail <cedric@osg.samsung.com>
Mon, 19 Mar 2018 22:39:14 +0000 (15:39 -0700)
committerWonki Kim <wonki_.kim@samsung.com>
Tue, 10 Apr 2018 11:22:00 +0000 (20:22 +0900)
src/lib/elementary/efl_ui_win.c
src/lib/elementary/elm_part_helper.h
src/lib/elementary/elm_widget.h

index 043741c..3a58f7b 100644 (file)
@@ -9294,6 +9294,7 @@ elm_win_window_id_get(const Evas_Object *obj)
    if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME_LEGACY))
      {
         Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
+        if (!ee) return NULL;
         return ecore_evas_window_get(ee);
      }
 
index 1402f49..019f356 100644 (file)
@@ -68,7 +68,7 @@ _elm_part_initialize(Eo *proxy, Eo *obj, const char *part)
 static inline Eo *
 ELM_PART_IMPLEMENT(const Efl_Class *part_klass, const Eo *obj, const char *part)
 {
-   return efl_add(part_klass, NULL,
+   return efl_add(part_klass, (Eo *) obj,
                   _elm_part_initialize(efl_added, (Eo *) obj, part));
 }
 
index 35986c6..f3688fd 100644 (file)
@@ -952,7 +952,7 @@ Eina_Bool _elm_widget_item_color_class_update(Elm_Widget_Item_Data *sd);
  *******/
 
 #define elm_legacy_add(k, p, ...) ({ \
-   efl_add(k, p, efl_canvas_object_legacy_ctor(efl_added), ##__VA_ARGS__); })
+       efl_add(k, p ? p : efl_main_loop_get(), efl_canvas_object_legacy_ctor(efl_added), ##__VA_ARGS__); })
 
 static inline Eo *
 elm_widget_resize_object_get(const Eo *obj)