Modified to get default input when focus lost 36/306336/1
authorInhong Han <inhong1.han@samsung.com>
Tue, 20 Feb 2024 08:49:09 +0000 (17:49 +0900)
committerInhong Han <inhong1.han@samsung.com>
Tue, 20 Feb 2024 08:49:09 +0000 (17:49 +0900)
Change-Id: I60bd139df15129ca7340f9e19059ef439b7352fe

ism/extras/wayland_immodule/wayland_imcontext.c

index 7d9ec16..08a3594 100644 (file)
@@ -1618,17 +1618,23 @@ set_focus_out(Ecore_IMF_Context *ctx)
         g_focused = EINA_FALSE;
         g_desired_key_rate = 0.0;
 
-        Ecore_Wl2_Input *input = ecore_wl2_window_keyboard_get(imcontext->window);
-        if (input) {
-            if (!ecore_wl2_input_keyboard_repeat_set (input, g_original_key_rate, g_original_key_delay)) {
-                LOGE ("ecore_wl2_input_keyboard_repeat_set failed.");
+        Ecore_Wl2_Display *wl2_display = ecore_wl2_connected_display_get(NULL);
+        if (wl2_display) {
+            Ecore_Wl2_Input *input = ecore_wl2_input_default_input_get(wl2_display);
+            if (input) {
+                if (!ecore_wl2_input_keyboard_repeat_set (input, g_original_key_rate, g_original_key_delay)) {
+                    LOGE ("ecore_wl2_input_keyboard_repeat_set failed.");
+                }
+                else {
+                    LOGD ("ecore_wl2_input_keyboard_repeat_set(%f, %f)", g_original_key_rate, g_original_key_delay);
+                }
             }
             else {
-                LOGD ("ecore_wl2_input_keyboard_repeat_set(%f, %f)", g_original_key_rate, g_original_key_delay);
+                LOGW("ctx : %p, Can't get Wl_Input", ctx);
             }
         }
         else {
-            LOGW("ctx : %p, Can't get Wl_Input", ctx);
+            LOGW("ctx : %p, Can't get Wl_Display", ctx);
         }
     }
 }