forked from enlightenment/efl
make elm inlined window focus in work and thus key events work. :)
SVN revision: 75534
This commit is contained in:
parent
782444ca1a
commit
6faa1f83da
|
@ -134,6 +134,14 @@ fill(Evas_Object *win, Eina_Bool do_bg)
|
||||||
evas_object_show(sc);
|
evas_object_show(sc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
cb_mouse_down(void *data __UNUSED__, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Evas_Event_Mouse_Down *ev = event_info;
|
||||||
|
|
||||||
|
if (ev->button == 1) elm_object_focus_set(obj, EINA_TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cb_mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info)
|
cb_mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info)
|
||||||
{
|
{
|
||||||
|
@ -219,6 +227,7 @@ test_win_inline(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_
|
||||||
evas_object_show(bg);
|
evas_object_show(bg);
|
||||||
|
|
||||||
win2 = elm_win_add(win, "inlined", ELM_WIN_INLINED_IMAGE);
|
win2 = elm_win_add(win, "inlined", ELM_WIN_INLINED_IMAGE);
|
||||||
|
evas_object_event_callback_add(elm_win_inlined_image_object_get(win2), EVAS_CALLBACK_MOUSE_DOWN, cb_mouse_down, NULL);
|
||||||
fill(win2, EINA_TRUE);
|
fill(win2, EINA_TRUE);
|
||||||
|
|
||||||
evas_object_move(win2, 20, 60);
|
evas_object_move(win2, 20, 60);
|
||||||
|
@ -230,6 +239,7 @@ test_win_inline(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_
|
||||||
evas_object_show(win2);
|
evas_object_show(win2);
|
||||||
|
|
||||||
win3 = elm_win_add(win, "inlined", ELM_WIN_INLINED_IMAGE);
|
win3 = elm_win_add(win, "inlined", ELM_WIN_INLINED_IMAGE);
|
||||||
|
evas_object_event_callback_add(elm_win_inlined_image_object_get(win3), EVAS_CALLBACK_MOUSE_DOWN, cb_mouse_down, NULL);
|
||||||
elm_win_alpha_set(win3, EINA_TRUE);
|
elm_win_alpha_set(win3, EINA_TRUE);
|
||||||
fill(win3, EINA_FALSE);
|
fill(win3, EINA_FALSE);
|
||||||
|
|
||||||
|
|
|
@ -1053,8 +1053,22 @@ elm_object_focus_set(Evas_Object *obj,
|
||||||
|
|
||||||
if (elm_widget_is(obj))
|
if (elm_widget_is(obj))
|
||||||
{
|
{
|
||||||
|
const char *type;
|
||||||
|
|
||||||
if (focus == elm_widget_focus_get(obj)) return;
|
if (focus == elm_widget_focus_get(obj)) return;
|
||||||
|
|
||||||
|
// ugly, but, special case for inlined windows
|
||||||
|
type = evas_object_type_get(obj);
|
||||||
|
if ((type) && (!strcmp(type, "elm_win")))
|
||||||
|
{
|
||||||
|
Evas_Object *inlined = elm_win_inlined_image_object_get(obj);
|
||||||
|
|
||||||
|
if (inlined)
|
||||||
|
{
|
||||||
|
evas_object_focus_set(inlined, focus);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (focus)
|
if (focus)
|
||||||
elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
|
elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
|
||||||
else
|
else
|
||||||
|
|
|
@ -680,7 +680,7 @@ _elm_win_focus_in(Ecore_Evas *ee)
|
||||||
EINA_SAFETY_ON_NULL_RETURN(sd);
|
EINA_SAFETY_ON_NULL_RETURN(sd);
|
||||||
|
|
||||||
obj = ELM_WIDGET_DATA(sd)->obj;
|
obj = ELM_WIDGET_DATA(sd)->obj;
|
||||||
|
|
||||||
_elm_widget_top_win_focused_set(obj, EINA_TRUE);
|
_elm_widget_top_win_focused_set(obj, EINA_TRUE);
|
||||||
if (!elm_widget_focus_order_get(obj))
|
if (!elm_widget_focus_order_get(obj))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue