summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-03-28 18:22:49 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-03-28 18:22:49 +0900
commit4baf67cb28eb1796d80f045787cc8843e256f50c (patch)
tree08258eaad4a5ccef6ea02a1e5989933089abde08
parent691250b1df45ef6015fc0bdeeaedad503a6e9290 (diff)
silence complaints getting top widget if object is not an elm widget
-rw-r--r--src/lib/elm_cnp.c31
-rw-r--r--src/lib/elm_widget.c1
2 files changed, 21 insertions, 11 deletions
diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c
index d261d9350..0d08c010f 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)
1784 Evas_Object *top, *par; 1784 Evas_Object *top, *par;
1785 Ecore_X_Window xwin = 0; 1785 Ecore_X_Window xwin = 0;
1786 1786
1787 top = elm_widget_top_get(obj); 1787 if (elm_widget_is(obj))
1788 if (!top)
1789 { 1788 {
1790 par = elm_widget_parent_widget_get(obj); 1789 top = elm_widget_top_get(obj);
1791 if (par) top = elm_widget_top_get(par); 1790 if (!top)
1791 {
1792 par = elm_widget_parent_widget_get(obj);
1793 if (par) top = elm_widget_top_get(par);
1794 }
1795 if (top) xwin = elm_win_xwindow_get(top);
1792 } 1796 }
1793 if (top) xwin = elm_win_xwindow_get(top);
1794 if (!xwin) 1797 if (!xwin)
1795 { 1798 {
1796 Ecore_Evas *ee; 1799 Ecore_Evas *ee;
@@ -2188,9 +2191,12 @@ _x11_elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data,
2188 elm_win_override_set(dragwin, EINA_TRUE); 2191 elm_win_override_set(dragwin, EINA_TRUE);
2189 2192
2190 /* dragwin has to be rotated as the main window is */ 2193 /* dragwin has to be rotated as the main window is */
2191 Evas_Object *win = elm_widget_top_get(obj); 2194 if (elm_widget_is(obj))
2192 if (win && eo_isa(win, ELM_OBJ_WIN_CLASS)) 2195 {
2193 elm_win_rotation_set(dragwin, elm_win_rotation_get(win)); 2196 Evas_Object *win = elm_widget_top_get(obj);
2197 if (win && eo_isa(win, ELM_OBJ_WIN_CLASS))
2198 elm_win_rotation_set(dragwin, elm_win_rotation_get(win));
2199 }
2194 2200
2195 if (createicon) 2201 if (createicon)
2196 { 2202 {
@@ -3379,9 +3385,12 @@ _wl_elm_widget_window_get(Evas_Object *obj)
3379 Evas_Object *top; 3385 Evas_Object *top;
3380 Ecore_Wl_Window *win = NULL; 3386 Ecore_Wl_Window *win = NULL;
3381 3387
3382 top = elm_widget_top_get(obj); 3388 if (elm_widget_is(obj))
3383 if (!top) top = elm_widget_top_get(elm_widget_parent_widget_get(obj)); 3389 {
3384 if (top) win = elm_win_wl_window_get(top); 3390 top = elm_widget_top_get(obj);
3391 if (!top) top = elm_widget_top_get(elm_widget_parent_widget_get(obj));
3392 if (top) win = elm_win_wl_window_get(top);
3393 }
3385 if (!win) 3394 if (!win)
3386 { 3395 {
3387 Ecore_Evas *ee; 3396 Ecore_Evas *ee;
diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index 2ad01bd93..aac52d469 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)
1422 if (sd->parent_obj) 1422 if (sd->parent_obj)
1423 { 1423 {
1424 Evas_Object *int_ret = NULL; 1424 Evas_Object *int_ret = NULL;
1425 if (!eo_isa(sd->parent_obj, ELM_OBJ_WIDGET_CLASS)) return NULL;
1425 eo_do((Eo *) sd->parent_obj, elm_obj_widget_top_get(&int_ret)); 1426 eo_do((Eo *) sd->parent_obj, elm_obj_widget_top_get(&int_ret));
1426 return int_ret; 1427 return int_ret;
1427 } 1428 }