elm_entry : Modified to prevent sending wrong input hint 28/210128/2
authorInHong Han <inhong1.han@samsung.com>
Tue, 16 Jul 2019 05:47:37 +0000 (14:47 +0900)
committerInHong Han <inhong1.han@samsung.com>
Tue, 16 Jul 2019 05:57:32 +0000 (05:57 +0000)
Change-Id: I96e82713d33b12281d85cc6b73a2dae097dbc469

src/lib/ecore_imf/ecore_imf_context.c
src/lib/elementary/elm_entry.c

index ee57601..34d5919 100644 (file)
@@ -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);
 
index 7ddc0a6..c299012 100644 (file)
@@ -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);
 }