Modified to prevent passing invalid IME geometry to the app 69/252869/1
authorInHong Han <inhong1.han@samsung.com>
Tue, 2 Feb 2021 07:59:08 +0000 (16:59 +0900)
committerInHong Han <inhong1.han@samsung.com>
Wed, 3 Feb 2021 03:26:39 +0000 (03:26 +0000)
Change-Id: I9dcce1647589922f3a18f404c796da8f0bca56d2
(cherry picked from commit 5e48582792c8bfac71fb72b0b5016e85f4304d9f)

ism/extras/wayland_immodule/wayland_imcontext.c

index 871bb2d..4a62e10 100644 (file)
@@ -141,7 +141,6 @@ static Eina_Bool             hw_keyboard_mode             = EINA_FALSE;
 static Eina_Bool             _preedit_cursor_changed      = EINA_FALSE;
 
 static Input_Language        input_lang                   = INPUT_LANG_OTHER;
-static Evas_Coord            g_scr_w = 0, g_scr_h = 0;
 
 static void set_autocapital (Ecore_IMF_Context *ctx);
 
@@ -349,13 +348,8 @@ static Eina_Bool show_input_panel(Ecore_IMF_Context *ctx);
 static void
 reset_keyboard_geometry ()
 {
-    Ecore_Wl2_Display *wl2_display = ecore_wl2_connected_display_get(NULL);
-    if (wl2_display && (g_scr_w == 0 || g_scr_h == 0)) {
-        ecore_wl2_sync();
-        ecore_wl2_display_screen_size_get(wl2_display, &g_scr_w, &g_scr_h);
-    }
     _keyboard_geometry.x = 0;
-    _keyboard_geometry.y = g_scr_h;
+    _keyboard_geometry.y = 0;
     _keyboard_geometry.w = 0;
     _keyboard_geometry.h = 0;
     _keyboard_geometry_notified = EINA_FALSE;
@@ -2320,7 +2314,9 @@ text_input_input_panel_state(void                 *data EINA_UNUSED,
             ECORE_IMF_INPUT_PANEL_STATE_EVENT,
             _input_panel_state);
 
-    if (state == WL_TEXT_INPUT_INPUT_PANEL_STATE_HIDE) {
+    if (state == WL_TEXT_INPUT_INPUT_PANEL_STATE_HIDE &&
+       !(!_keyboard_geometry.x && !_keyboard_geometry.y && !_keyboard_geometry.w && !_keyboard_geometry.h &&
+       _keyboard_geometry_notified)) {
         reset_keyboard_geometry();
         send_keyboard_geometry_event(imcontext->ctx);
     }