cnp: check object type before getting window id

Summary:
problem:
1) elementary_test -> entry -> close entry window
2) type mismatch warning is shown on console as below

ERR<19427>:eo lib/eo/eo.c:342 _eo_dov_internal() in elm_win.eo.c:2067: Can't execute function Elm_Win:ELM_OBJ_WIN_SUB_ID_XWINDOW_GET (op 0x167) for class 'Elm_Entry'. Aborting.

solution:
check top object type before invoke elm_win_xwindow_get()/elm_wl_window_get().
if it's not a window, find window id by using ecore_evas APIs.

Fixes T1141

Test Plan: elementary_test -> entry -> close entry window -> check console

Reviewers: raster, seoz, uartie

Reviewed By: raster

CC: seoz

Maniphest Tasks: T1141

Differential Revision: https://phab.enlightenment.org/D684
This commit is contained in:
wonguk.jeong 2014-04-01 19:54:09 +09:00 committed by Carsten Haitzler (Rasterman)
parent 3f1e7f6851
commit 26ebe359c7
1 changed files with 4 additions and 2 deletions

View File

@ -1826,7 +1826,8 @@ _x11_elm_widget_xwin_get(const Evas_Object *obj)
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 && (eo_isa(top, ELM_OBJ_WIN_CLASS)))
xwin = elm_win_xwindow_get(top);
}
if (!xwin)
{
@ -3423,7 +3424,8 @@ _wl_elm_widget_window_get(Evas_Object *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 (top && (eo_isa(top, ELM_OBJ_WIN_CLASS)))
win = elm_win_wl_window_get(top);
}
if (!win)
{