raster pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=4baf67cb28eb1796d80f045787cc8843e256f50c

commit 4baf67cb28eb1796d80f045787cc8843e256f50c
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Fri Mar 28 18:22:49 2014 +0900

    silence complaints getting top widget if object is not an elm widget
---
 src/lib/elm_cnp.c    | 31 ++++++++++++++++++++-----------
 src/lib/elm_widget.c |  1 +
 2 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c
index d261d93..0d08c01 100644
--- a/src/lib/elm_cnp.c
+++ b/src/lib/elm_cnp.c
@@ -1784,13 +1784,16 @@ _x11_elm_widget_xwin_get(const Evas_Object *obj)
    Evas_Object *top, *par;
    Ecore_X_Window xwin = 0;
 
-   top = elm_widget_top_get(obj);
-   if (!top)
+   if (elm_widget_is(obj))
      {
-        par = elm_widget_parent_widget_get(obj);
-        if (par) top = elm_widget_top_get(par);
+        top = elm_widget_top_get(obj);
+        if (!top)
+          {
+             par = elm_widget_parent_widget_get(obj);
+             if (par) top = elm_widget_top_get(par);
+          }
+        if (top) xwin = elm_win_xwindow_get(top);
      }
-   if (top) xwin = elm_win_xwindow_get(top);
    if (!xwin)
      {
         Ecore_Evas *ee;
@@ -2188,9 +2191,12 @@ _x11_elm_drag_start(Evas_Object *obj, Elm_Sel_Format 
format, const char *data,
    elm_win_override_set(dragwin, EINA_TRUE);
 
    /* dragwin has to be rotated as the main window is */
-   Evas_Object *win = elm_widget_top_get(obj);
-   if (win && eo_isa(win, ELM_OBJ_WIN_CLASS))
-     elm_win_rotation_set(dragwin, elm_win_rotation_get(win));
+   if (elm_widget_is(obj))
+     {
+        Evas_Object *win = elm_widget_top_get(obj);
+        if (win && eo_isa(win, ELM_OBJ_WIN_CLASS))
+          elm_win_rotation_set(dragwin, elm_win_rotation_get(win));
+     }
 
    if (createicon)
      {
@@ -3379,9 +3385,12 @@ _wl_elm_widget_window_get(Evas_Object *obj)
    Evas_Object *top;
    Ecore_Wl_Window *win = NULL;
 
-   top = elm_widget_top_get(obj);
-   if (!top) top = elm_widget_top_get(elm_widget_parent_widget_get(obj));
-   if (top) win = elm_win_wl_window_get(top);
+   if (elm_widget_is(obj))
+     {
+        top = elm_widget_top_get(obj);
+        if (!top) top = elm_widget_top_get(elm_widget_parent_widget_get(obj));
+        if (top) win = elm_win_wl_window_get(top);
+     }
    if (!win)
      {
         Ecore_Evas *ee;
diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index 2ad01bd..aac52d4 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -1422,6 +1422,7 @@ _elm_widget_top_get(Eo *obj, Elm_Widget_Smart_Data *sd)
    if (sd->parent_obj)
      {
         Evas_Object *int_ret = NULL;
+        if (!eo_isa(sd->parent_obj, ELM_OBJ_WIDGET_CLASS)) return NULL;
         eo_do((Eo *) sd->parent_obj, elm_obj_widget_top_get(&int_ret));
         return int_ret;
      }

-- 


Reply via email to