e_focus_policy_history: implement comp_object_hide callback 51/297551/1
authorSooChan Lim <sc1.lim@samsung.com>
Thu, 10 Aug 2023 07:32:04 +0000 (16:32 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 21 Aug 2023 07:58:39 +0000 (16:58 +0900)
Add the code at the hooks call of E_COMP_OBJECT_HOOK_HIDE.

Change-Id: I4f9434ecee6b8fc64622e22a45bd54c00af0f608

src/bin/e_focus_policy_history.c

index 9bd98a5..6235aea 100644 (file)
@@ -649,7 +649,17 @@ _focus_policy_history_hook_cb_comp_object_show(void *data, E_Client *ec)
 static Eina_Bool
 _focus_policy_history_hook_cb_comp_object_hide(void *data, E_Client *ec)
 {
-   // TODO:
+   E_Focus_Policy_History *history_policy;
+
+   history_policy = (E_Focus_Policy_History *)data;
+   if (!history_policy) return EINA_TRUE;
+
+   if (history_policy->focused_ec != ec) return EINA_TRUE;
+
+   /* ensure focus-out */
+   ELOGF("FOCUS", "focus unset | comp_object_hide ", ec);
+   e_client_frame_focus_set(ec, EINA_FALSE);
+   _e_focus_policy_history_focus_defer_unset(history_policy, ec);
 
    return EINA_TRUE;
 }