Fixed the surrounding text not being delivered when moving focus 34/302434/1
authorInhong Han <inhong1.han@samsung.com>
Wed, 6 Dec 2023 11:33:42 +0000 (20:33 +0900)
committerInhong Han <inhong1.han@samsung.com>
Wed, 6 Dec 2023 11:33:42 +0000 (20:33 +0900)
Change-Id: I740560566ebd4c4af2b105784a5ef4630e0144ec

ism/extras/wayland_immodule/wayland_imcontext.c

index 724ec07..9ee375f 100644 (file)
@@ -1281,7 +1281,7 @@ static char *get_splited_string(int start, int end, char *text)
 }
 
 static void
-send_surrounding_text(WaylandIMContext *imcontext)
+send_surrounding_text(WaylandIMContext *imcontext, Eina_Bool force_update)
 {
     int cursor_pos;
     char *surrounding = NULL;
@@ -1302,7 +1302,7 @@ send_surrounding_text(WaylandIMContext *imcontext)
             need_update = EINA_TRUE;
         }
 
-        if (need_update) {
+        if (need_update || force_update) {
             if (imcontext->input && imcontext->text_input) {
                 if (imcontext->surrounding_text)
                     free (imcontext->surrounding_text);
@@ -1350,7 +1350,7 @@ update_state(WaylandIMContext *imcontext)
     if (!imcontext->ctx)
         return;
 
-    send_surrounding_text (imcontext);
+    send_surrounding_text (imcontext, EINA_FALSE);
     send_cursor_location (imcontext);
 
     if (imcontext->input && imcontext->text_input) {
@@ -2138,7 +2138,7 @@ text_input_preedit_string(void                 *data,
         }
     }
 
-    send_surrounding_text (imcontext);
+    send_surrounding_text (imcontext, EINA_FALSE);
 }
 
 static void
@@ -3302,7 +3302,7 @@ wayland_im_context_focus_in(Ecore_IMF_Context *ctx)
     if (_TV)
         hw_keyboard_mode = EINA_FALSE;
 
-    send_surrounding_text (imcontext);
+    send_surrounding_text (imcontext, EINA_TRUE);
 
     if (ecore_imf_context_input_panel_enabled_get(ctx))
         if (!ecore_imf_context_input_panel_show_on_demand_get (ctx))
@@ -3421,7 +3421,7 @@ wayland_im_context_cursor_position_set (Ecore_IMF_Context *ctx,
             LOGD ("ctx : %p, cursor pos : %d", ctx, cursor_pos);
 
             set_autocapital (ctx);
-            send_surrounding_text (imcontext);
+            send_surrounding_text (imcontext, EINA_FALSE);
 
             if (!imcontext->preedit_text || strlen(imcontext->preedit_text) == 0)
                 wl_text_input_set_cursor_position (imcontext->text_input, cursor_pos);