Fix blocking issue when pressing back key in case focus context is different from... 31/117331/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Sat, 4 Mar 2017 07:22:52 +0000 (16:22 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Sat, 4 Mar 2017 07:22:52 +0000 (16:22 +0900)
Change-Id: I647e422433a318e36f3392b28b33434ae8fc54e4
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
ism/extras/wayland_immodule/wayland_imcontext.c

index 66a8e8d..7c7fd31 100644 (file)
@@ -693,9 +693,15 @@ key_down_filter_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
         return EINA_FALSE; /* the event is removed from the queue */
 #else
         Ecore_IMF_Event_Key_Down imf_event;
+        Eina_Bool filter_ret = EINA_FALSE;
+
         _ecore_event_to_ecore_imf_key_down_event(ev, &imf_event);
 
-        Eina_Bool filter_ret = ecore_imf_context_filter_event(active_ctx, ECORE_IMF_EVENT_KEY_DOWN, (Ecore_IMF_Event *)&imf_event);
+        if (_focused_ctx)
+            filter_ret = ecore_imf_context_filter_event(_focused_ctx, ECORE_IMF_EVENT_KEY_DOWN, (Ecore_IMF_Event *)&imf_event);
+        else
+            LOGD("no focus\n");
+
         LOGD ("%s key is pressed. ret : %d\n", ev->keyname, filter_ret);
         if (filter_ret) {
             return EINA_FALSE; /* the event is removed from the queue */
@@ -734,9 +740,15 @@ key_up_filter_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
     return EINA_FALSE; /* the event is removed from the queue */
 #else
     Ecore_IMF_Event_Key_Up imf_event;
+    Eina_Bool filter_ret = EINA_FALSE;
+
     _ecore_event_to_ecore_imf_key_up_event(ev, &imf_event);
 
-    Eina_Bool filter_ret = ecore_imf_context_filter_event(active_ctx, ECORE_IMF_EVENT_KEY_UP, (Ecore_IMF_Event *)&imf_event);
+    if (_focused_ctx)
+        filter_ret = ecore_imf_context_filter_event(_focused_ctx, ECORE_IMF_EVENT_KEY_UP, (Ecore_IMF_Event *)&imf_event);
+    else
+        LOGD("no focus\n");
+
     LOGD ("%s key is released. ret : %d\n", ev->keyname, filter_ret);
     if (filter_ret) {
         return EINA_FALSE; /* the event is removed from the queue */