From: Marcel Hollerbach Date: Sun, 11 Feb 2018 18:04:06 +0000 (+0000) Subject: efl_ui_win: move inital focus set to focus_in handler X-Git-Tag: upstream/1.21.0~2030 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=47cee8792a40b82d481d8b8fe90782ba8e959738;p=platform%2Fupstream%2Fefl.git efl_ui_win: move inital focus set to focus_in handler it seems that focus changes to FOCUS=FALSE are causing autodel windows to kill themself, so we only set the focus on the window if the window manager calls focus in AND we dont have anything to focus and nothing is focused yet. --- diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index ed0f37a..0dbb460 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -1469,6 +1469,17 @@ _elm_win_focus_in(Ecore_Evas *ee) /* else if (sd->img_obj) */ /* { */ /* } */ + if (!efl_ui_focus_manager_focus_get(sd->obj) && !efl_ui_focus_manager_redirect_get(sd->obj)) + { + Efl_Ui_Focus_Object *child; + + child = efl_ui_focus_manager_request_subchild(sd->obj, sd->obj); + + if (child) + efl_ui_focus_manager_focus_set(sd->obj, sd->obj); + else + evas_object_focus_set(sd->obj, EINA_TRUE); + } } static void @@ -5876,8 +5887,6 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U efl_constructor(efl_super(obj, MY_CLASS)); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); - evas_object_focus_set(obj, EINA_TRUE); - if (getenv("ELM_FIRST_FRAME")) evas_event_callback_add(ecore_evas_get(tmp_sd.ee), EVAS_CALLBACK_RENDER_POST, _elm_win_first_frame_do, getenv("ELM_FIRST_FRAME"));