From 0252dad87fe8dbefdaa4603b4227b88c2bd13108 Mon Sep 17 00:00:00 2001 From: InHong Han Date: Tue, 16 Jul 2019 14:47:37 +0900 Subject: [PATCH] elm_entry : Modified to prevent sending wrong input hint Change-Id: I96e82713d33b12281d85cc6b73a2dae097dbc469 --- src/lib/ecore_imf/ecore_imf_context.c | 5 +++++ src/lib/elementary/elm_entry.c | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/lib/ecore_imf/ecore_imf_context.c b/src/lib/ecore_imf/ecore_imf_context.c index ee57601..34d5919 100644 --- a/src/lib/ecore_imf/ecore_imf_context.c +++ b/src/lib/ecore_imf/ecore_imf_context.c @@ -882,6 +882,11 @@ ecore_imf_context_input_hint_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Hints i if (ctx->input_hints != input_hints) { + if (input_hints & ECORE_IMF_INPUT_HINT_AUTO_COMPLETE) + ctx->allow_prediction = EINA_TRUE; + else + ctx->allow_prediction = EINA_FALSE; + if (ctx->klass && ctx->klass->input_hint_set) ctx->klass->input_hint_set(ctx, input_hints); diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c index 7ddc0a6..c299012 100644 --- a/src/lib/elementary/elm_entry.c +++ b/src/lib/elementary/elm_entry.c @@ -7050,6 +7050,12 @@ EOLIAN static void _elm_entry_prediction_allow_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Eina_Bool prediction) { sd->prediction_allow = prediction; + + if (prediction == EINA_FALSE) + sd->input_hints &= ~ELM_INPUT_HINT_AUTO_COMPLETE; + else + sd->input_hints |= ELM_INPUT_HINT_AUTO_COMPLETE; + edje_object_part_text_prediction_allow_set (sd->entry_edje, "elm.text", prediction); } @@ -7065,6 +7071,11 @@ _elm_entry_input_hint_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Elm_Input_Hin { sd->input_hints = hints; + if (hints & ELM_INPUT_HINT_AUTO_COMPLETE) + sd->prediction_allow = EINA_TRUE; + else + sd->prediction_allow = EINA_FALSE; + edje_object_part_text_input_hint_set (sd->entry_edje, "elm.text", (Edje_Input_Hints)hints); } -- 2.7.4