reset input panel state if state callback will not be called in 5 seconds
authorJihoon Kim <jihoon48.kim@samsung.com>
Wed, 27 Mar 2013 12:17:01 +0000 (21:17 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 29 Mar 2013 04:28:09 +0000 (13:28 +0900)
Change-Id: I127cb8d683efe1dde2c571cc64384628dfa47204

ism/extras/efl_immodule/isf_imf_context.h
ism/extras/efl_immodule/isf_imf_control_ui.cpp

index bbb849c8632707c07653d87ab8fddd72af3d2aea..4bf2496d5d14957dbe91cff982ca5aa607d54fbf 100644 (file)
@@ -33,6 +33,7 @@
 
 const double DOUBLE_SPACE_INTERVAL = 1.0;
 const double HIDE_TIMER_INTERVAL = 0.05;
+const double WILL_SHOW_TIMER_INTERVAL = 5.0;
 
 typedef struct _EcoreIMFContextISF      EcoreIMFContextISF;
 typedef struct _EcoreIMFContextISFImpl  EcoreIMFContextISFImpl;
index b63878fb29e3a60a0ec770a844c9c4b72dc643d2..bd1bb65bbf81191f503930e2f7e5fee192eb5c22 100644 (file)
@@ -48,6 +48,7 @@ static Ecore_X_Atom       prop_x_ext_keyboard_exist = 0;
 static Ecore_X_Window     _rootwin;
 static unsigned int       hw_kbd_num = 0;
 static Ecore_Timer       *hide_timer = NULL;
+static Ecore_Timer       *will_show_timer = NULL;
 static Ecore_IMF_Input_Panel_State input_panel_state = ECORE_IMF_INPUT_PANEL_STATE_HIDE;
 static int                hide_context_id = -1;
 static Evas              *active_context_canvas = NULL;
@@ -281,6 +282,15 @@ static Eina_Bool _hide_timer_handler (void *data)
     return ECORE_CALLBACK_CANCEL;
 }
 
+static Eina_Bool _will_show_timer_handler (void *data)
+{
+    LOGD ("reset input panel state as HIDE");
+
+    input_panel_state = ECORE_IMF_INPUT_PANEL_STATE_HIDE;
+    will_show_timer = NULL;
+    return ECORE_CALLBACK_CANCEL;
+}
+
 static void _input_panel_hide_timer_start (void *data)
 {
     Ecore_IMF_Context *ctx = (Ecore_IMF_Context *)data;
@@ -407,6 +417,11 @@ void isf_imf_input_panel_shutdown (void)
 
     _win_focus_out_handler_del ();
 
+    if (will_show_timer) {
+        ecore_timer_del (will_show_timer);
+        will_show_timer = NULL;
+    }
+
     if (hide_timer) {
         if (input_panel_state != ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
             Ecore_IMF_Context *using_ic = NULL;
@@ -543,9 +558,15 @@ void isf_imf_context_input_panel_show (Ecore_IMF_Context* ctx)
 
     _isf_imf_context_input_panel_show (get_panel_client_id (), context_id, packet, length, input_panel_show);
 
-    if (input_panel_show == true && input_panel_state == ECORE_IMF_INPUT_PANEL_STATE_HIDE)
+    if (input_panel_show == true && input_panel_state == ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
         input_panel_state = ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW;
 
+        if (will_show_timer)
+            ecore_timer_del (will_show_timer);
+
+        will_show_timer = ecore_timer_add (WILL_SHOW_TIMER_INTERVAL, _will_show_timer_handler, NULL);
+    }
+
     free (packet);
 
     caps_mode_check (ctx, EINA_TRUE, EINA_TRUE);
@@ -930,6 +951,10 @@ static bool _process_update_input_context (Transaction &trans)
                 return true;
             case ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW:
                 input_panel_state = ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW;
+                if (will_show_timer) {
+                    ecore_timer_del (will_show_timer);
+                    will_show_timer = NULL;
+                }
                 break;
             case SCIM_INPUT_PANEL_STATE_WILL_HIDE:
                 break;