cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=08c9f99134102db1a54ce0761b8e175ffed2d4bd

commit 08c9f99134102db1a54ce0761b8e175ffed2d4bd
Author: Cedric Bail <[email protected]>
Date:   Mon Mar 19 15:39:14 2018 -0700

    elementary: make sure windows are not born orfan and properly have at least 
a main loop as parent.
---
 src/lib/elementary/efl_ui_win.c      | 3 ++-
 src/lib/elementary/elm_part_helper.h | 2 +-
 src/lib/elementary/elm_widget.h      | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index cb7c6b02be..6ca99d14e6 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -8259,6 +8259,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);
      }
 
@@ -8654,7 +8655,7 @@ elm_win_add(Evas_Object *parent, const char *name, 
Efl_Ui_Win_Type type)
       default: break;
      }
 
-   return elm_legacy_add(klass, parent, 
+   return elm_legacy_add(klass, parent,
                          efl_ui_win_name_set(efl_added, name),
                          efl_ui_win_type_set(efl_added, type));
 }
diff --git a/src/lib/elementary/elm_part_helper.h 
b/src/lib/elementary/elm_part_helper.h
index 1402f49adb..019f35623e 100644
--- a/src/lib/elementary/elm_part_helper.h
+++ b/src/lib/elementary/elm_part_helper.h
@@ -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));
 }
 
diff --git a/src/lib/elementary/elm_widget.h b/src/lib/elementary/elm_widget.h
index 81b9339066..3d7b325297 100644
--- a/src/lib/elementary/elm_widget.h
+++ b/src/lib/elementary/elm_widget.h
@@ -823,7 +823,7 @@ _elm_widget_sub_object_redirect_to_top(Evas_Object *obj, 
Evas_Object *sobj)
 }
 
 #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)

-- 


Reply via email to