From 078f3e68c944d05694b35e602ffd36614de1ee66 Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Mon, 13 Jan 2020 09:05:22 +0900 Subject: [PATCH] add code to check effect state while handling hide keyboard request There was a bug that the application view was corruptted when the HW keyboard was pressed while show effect of SW keyboard was run. Change-Id: I0ac152b1e502fa744d929299beade229b434ff8d --- src/e_mod_input_panel.c | 30 ++++++++++++++++++++++++++++++ src/e_mod_main.c | 4 ++++ src/e_mod_main.h | 1 + 3 files changed, 35 insertions(+) diff --git a/src/e_mod_input_panel.c b/src/e_mod_input_panel.c index e3f3a71..0bd3cb0 100644 --- a/src/e_mod_input_panel.c +++ b/src/e_mod_input_panel.c @@ -1615,3 +1615,33 @@ e_input_panel_surface_destroy(E_Client *ec) return EINA_TRUE; } + +/* check whether the keyboard effect is running or not + - 0 : effect is not running, + - otherwise : effect is running */ +int e_input_panel_is_effect_running(void) +{ + E_Input_Panel_Surface *ips = NULL; + Eina_List *l = NULL; + int run_type = 0; + + EINA_LIST_FOREACH(g_input_panel->surfaces, l, ips) + { + if (!ips || !ips->ec) continue; + if (_e_input_panel_is_effect_running(ips->ec)) + { + /* + Do we need to check currently effect type? + then what flag do we check? ips->ec->visible or ips->showing? + */ + if (ips->ec->visible) + run_type = 1; // show effect is running + else + run_type = 2; // hide effect is running + + break; + } + } + + return run_type; +} diff --git a/src/e_mod_main.c b/src/e_mod_main.c index ef71948..bbaf1f2 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -235,6 +235,7 @@ _input_panel_hide(struct wl_client *client, struct wl_resource *resource, Eina_B Eina_Bool _context_created = EINA_FALSE; E_Zone *zone = NULL; double timeout; + int effect_run; if (!text_input) { @@ -272,8 +273,11 @@ _input_panel_hide(struct wl_client *client, struct wl_resource *resource, Eina_B } zone = e_zone_current_get(); + effect_run = e_input_panel_is_effect_running(); if (zone && (zone->display_state == E_ZONE_DISPLAY_STATE_OFF)) timeout = 0.0f; + else if (effect_run) + timeout = 0.0f; else timeout = WILL_HIDE_TIMER_INTERVAL; g_timer_will_hide = ecore_timer_add(timeout, _will_hide_timer_handler, NULL); diff --git a/src/e_mod_main.h b/src/e_mod_main.h index 2c7ac23..1ad4a2a 100644 --- a/src/e_mod_main.h +++ b/src/e_mod_main.h @@ -23,6 +23,7 @@ void e_input_panel_show_need_rerun_set(Eina_Bool need_rerun); void e_input_panel_floating_position_set(int x, int y); void e_text_input_update_input_panel_state(Eina_Bool state); Eina_Bool e_input_panel_surface_destroy(E_Client *ec); +int e_input_panel_is_effect_running(void); typedef enum { TIZEN_PROFILE_UNKNOWN = 0, -- 2.7.4