ref-fusion : fix drop logic to handle focus client terminated case 18/264218/1
authorulgal-park <ulgal.park@samsung.com>
Tue, 14 Sep 2021 09:00:32 +0000 (18:00 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Tue, 14 Sep 2021 12:13:22 +0000 (21:13 +0900)
Change-Id: I3cf2583b36dadc815342974907f26820f64009b0

src/modules/ref_fusion/mmi-ref-fusion.c

index 5898086..8e95a49 100644 (file)
@@ -62,7 +62,6 @@ unsigned long long state_caps[MMI_STATE_TERMINATION+1] =
        MODALITY_PROVIDER_CAP_VISION_EVENT
 };
 
-mmi_client *_prev_focus_client = NULL;
 mmi_client *_focus_client = NULL;
 mmi_state _prev_state = MMI_STATE_NONE;
 mmi_state _state = MMI_STATE_NONE;
@@ -86,24 +85,16 @@ _focus_change_cb(void *data EINA_UNUSED, int type, void *event)
                return ECORE_CALLBACK_PASS_ON;
        }
 
-       if (ev->cur_focus)
+       if (!ev->cur_focus && !ev->new_focus){
+               state = _state;
+               _state = MMI_STATE_NONE;
+       }
+       else if (ev->cur_focus)
        {
                //Set op_mode to MODALITY_PROVIDER_MODE_DROP_EVENT
                state = client_manager_get_client_state(ev->cur_focus);
                LOGI("state=%d, ev->cur_focus(%p) !\n", state, ev->cur_focus);
        }
-       else if (_focus_client)
-       {
-               //Set op_mode to MODALITY_PROVIDER_MODE_DROP_EVENT
-               state = client_manager_get_client_state(_focus_client);
-               LOGI("state=%d, _focus_client(%p) !\n", state, _focus_client);
-       }
-
-       if (state == MMI_STATE_NONE)
-       {
-               state = _state;
-               _state = MMI_STATE_NONE;
-       }
 
        if (state != MMI_STATE_NONE)
        {
@@ -119,7 +110,6 @@ _focus_change_cb(void *data EINA_UNUSED, int type, void *event)
                }
        }
 
-       _prev_focus_client = ev->cur_focus;
        _focus_client = ev->new_focus;
 
        return ECORE_CALLBACK_PASS_ON;