From 059e82d4c1c7a49bae40b83178a9efb7e3be1175 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Tue, 16 Jul 2019 13:58:48 +0200 Subject: [PATCH] efl_ui_text: fix focus breaking Summary: text should not be focusable by default. Only focusable if it is editable. This fixes mysterical focus disappearing in tests using efl.ui.text. Depends on D9327 Reviewers: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9328 --- src/lib/elementary/efl_ui_text.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 34e8a4f62b..3201c8875e 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -2213,7 +2213,7 @@ _efl_ui_text_efl_object_finalize(Eo *obj, efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _text_size_changed_cb, obj); - elm_widget_can_focus_set(obj, EINA_TRUE); + efl_ui_widget_focus_allow_set(obj, sd->editable); efl_ui_text_input_panel_layout_set(obj, ELM_INPUT_PANEL_LAYOUT_NORMAL); efl_ui_text_input_panel_enabled_set(obj, EINA_TRUE); @@ -2390,6 +2390,7 @@ _efl_ui_text_efl_text_interactive_editable_set(Eo *obj, Efl_Ui_Text_Data *sd, Ei if (sd->editable == editable) return; sd->editable = editable; efl_ui_widget_theme_apply(obj); + efl_ui_widget_focus_allow_set(obj, editable); elm_drop_target_del(obj, sd->drop_format, _dnd_enter_cb, NULL,