Revert "Memorize last activated ctx even after deactivate request" 36/121436/2
authorJihoon Kim <jihoon48.kim@samsung.com>
Tue, 28 Mar 2017 04:36:13 +0000 (21:36 -0700)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 28 Mar 2017 04:36:20 +0000 (21:36 -0700)
This reverts commit d275c3671d2a3d8d3baa767ebbdc5164b4236bcd.

Change-Id: I1a66d18995439b9d1f6fd92d4acefba5bf8f62ef

src/e_mod_main.c

index a1d0132..766b11f 100644 (file)
@@ -1127,7 +1127,6 @@ _e_text_input_deactivate(E_Text_Input *text_input, E_Input_Method *input_method,
              ecore_key_down_handler = NULL;
           }
 
-        LOGD("Resetting input_method->input : %p", input_method->input);
         input_method->input = NULL;
         if (input_method->context) input_method->context->input = NULL;
         input_method->context = NULL;
@@ -1150,7 +1149,6 @@ _e_text_input_cb_activate(struct wl_client *client, struct wl_resource *resource
    E_Input_Method *input_method = NULL;
    E_Text_Input *old = NULL;
    E_Input_Method_Context *context = NULL;
-   static E_Text_Input *last_input = NULL;
 
    EINA_SAFETY_ON_NULL_GOTO(resource, err);
    EINA_SAFETY_ON_NULL_GOTO(seat, err);
@@ -1174,21 +1172,18 @@ _e_text_input_cb_activate(struct wl_client *client, struct wl_resource *resource
    LOGD("text_input : %p\n", text_input);
 
    old = input_method->input;
-
-   LOGD("old : %p, text_input : %p , %d", old, text_input, g_input_panel_state);
    if (old == text_input)
      return;
 
    if (old)
-     _e_text_input_deactivate(old, input_method, EINA_TRUE);
-
-   if (last_input)
      {
-        if (g_old_text_input != last_input)
-          g_old_text_input = last_input;
-        LOGD("g_old_text_input : %p", g_old_text_input);
+        _e_text_input_deactivate(old, input_method, EINA_TRUE);
+        if (g_input_panel_state == E_INPUT_PANEL_STATE_DID_SHOW ||
+            g_input_panel_state == E_INPUT_PANEL_STATE_WILL_SHOW)
+          {
+             g_old_text_input = old;
+          }
      }
-   last_input = text_input;
 
    input_method->input = text_input;
    text_input->input_methods = eina_list_append(text_input->input_methods, input_method);
@@ -1249,7 +1244,6 @@ err:
 static void
 _e_text_input_cb_deactivate(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *seat)
 {
-   LOGD("");
    E_Text_Input *text_input = wl_resource_get_user_data(resource);
    E_Input_Method *input_method = NULL;
 
@@ -1270,7 +1264,6 @@ _e_text_input_cb_deactivate(struct wl_client *client EINA_UNUSED, struct wl_reso
    if (text_input == g_old_text_input)
      {
         g_old_text_input = NULL;
-        LOGD("g_old_text_input : %p", g_old_text_input);
      }
 
    /* FIXME: should get input_method object from seat. */