add code to check effect state while handling hide keyboard request 36/222236/2
authorDoyoun Kang <doyoun.kang@samsung.com>
Mon, 13 Jan 2020 00:05:22 +0000 (09:05 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Mon, 13 Jan 2020 02:07:18 +0000 (11:07 +0900)
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
src/e_mod_main.c
src/e_mod_main.h

index e3f3a71..0bd3cb0 100644 (file)
@@ -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;
+}
index ef71948..bbaf1f2 100644 (file)
@@ -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);
index 2c7ac23..1ad4a2a 100644 (file)
@@ -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,