From bd8d47af4402e82fae9c48d1ab8809b296640cf9 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Tue, 13 Feb 2018 15:21:49 +0900 Subject: [PATCH] elm - dont get top widget for non-ui objects --- src/lib/elementary/efl_selection.c | 17 ++++++++++------- src/lib/elementary/efl_ui_dnd.c | 3 ++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/lib/elementary/efl_selection.c b/src/lib/elementary/efl_selection.c index 2cb05df..f81c0af 100644 --- a/src/lib/elementary/efl_selection.c +++ b/src/lib/elementary/efl_selection.c @@ -115,15 +115,18 @@ _wl_default_seat_id_get(Evas_Object *obj) if (obj) { - Eo *top = elm_widget_top_get(obj); - if (efl_isa(top, EFL_UI_WIN_INLINED_CLASS)) + if (efl_isa(obj, EFL_UI_WIDGET_CLASS)) { - parent2 = efl_ui_win_inlined_parent_get(top); - if (parent2) obj = elm_widget_top_get(parent2) ?: parent2; + Eo *top = elm_widget_top_get(obj); + if (efl_isa(top, EFL_UI_WIN_INLINED_CLASS)) + { + parent2 = efl_ui_win_inlined_parent_get(top); + if (parent2) obj = elm_widget_top_get(parent2) ?: parent2; + } + /* fake win means canvas seat id will not match protocol seat id */ + ewin = elm_win_get(obj); + if (elm_win_type_get(ewin) == ELM_WIN_FAKE) obj = NULL; } - /* fake win means canvas seat id will not match protocol seat id */ - ewin = elm_win_get(obj); - if (elm_win_type_get(ewin) == ELM_WIN_FAKE) obj = NULL; } if (!obj) diff --git a/src/lib/elementary/efl_ui_dnd.c b/src/lib/elementary/efl_ui_dnd.c index a05bf61..d0a1df7 100644 --- a/src/lib/elementary/efl_ui_dnd.c +++ b/src/lib/elementary/efl_ui_dnd.c @@ -21,9 +21,10 @@ struct _Efl_Ui_Dnd_Container_Data extern int _wl_default_seat_id_get(Evas_Object *obj); -static inline Eo* +static inline Eo * _selection_manager_get(Eo *obj) { + if (!efl_isa(obj, EFL_UI_WIDGET_CLASS)) return NULL; Eo *top = elm_widget_top_get(obj); if (!top) { -- 2.7.4