e_focus_policy: make a E_CLIENT_HOOK_ACTIVATE_DONE callback 34/297534/1
authorSooChan Lim <sc1.lim@samsung.com>
Thu, 10 Aug 2023 01:54:07 +0000 (10:54 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 21 Aug 2023 07:58:39 +0000 (16:58 +0900)
The focus may be changed at E_CLIENT_HOOK_ACTIVATE_DONE callback.

Change-Id: Idc19863ecd4041c193553a54bb90279c7e9a16f7

src/bin/e_client.c
src/bin/e_focus_policy_history.c

index 7cb48f5..0111a09 100644 (file)
@@ -5359,6 +5359,9 @@ e_client_activate(E_Client *ec)
      e_client_raise(ec);
    if (ec->shaded || ec->shading)
      e_client_unshade(ec, ec->shade_dir);
+#ifdef REFACTOR_FOCUS_POLICY
+    // This code will be executed at E_CLIENT_HOOK_ACTIVATE_DONE callback at e_focus_policy_history.c
+#else
    if (!ec->lock_focus_out)
      {
         E_Client *focus_ec = NULL;
@@ -5399,6 +5402,7 @@ e_client_activate(E_Client *ec)
             e_client_focus_latest_set(focus_ec);
           }
      }
+#endif
 
   if (!e_client_desk_iconify_skip_get(ec))
     {
index 0c804a1..71ec701 100644 (file)
@@ -126,6 +126,12 @@ _focus_policy_history_hook_cb_client_focus_latest_set(void *data, E_Client *ec)
 }
 
 static void
+_focus_policy_history_hook_cb_client_activate_done(void *data, E_Client *ec)
+{
+   // TODO:
+}
+
+static void
 _focus_policy_history_hook_cb_client_eval_end(void *data, E_Client *ec)
 {
    // TODO:
@@ -254,6 +260,7 @@ e_focus_policy_iface_history_new(E_Zone* zone)
    E_LIST_HOOK_APPEND(history_policy->ec_hooks, E_CLIENT_HOOK_FOCUS_UNSET, _focus_policy_history_hook_cb_client_focus_unset, history_policy);
    E_LIST_HOOK_APPEND(history_policy->ec_hooks, E_CLIENT_HOOK_FOCUS_DEFER_SET, _focus_policy_history_hook_cb_client_focus_defer_set, history_policy);
    E_LIST_HOOK_APPEND(history_policy->ec_hooks, E_CLIENT_HOOK_FOCUS_LATEST_SET, _focus_policy_history_hook_cb_client_focus_latest_set, history_policy);
+   E_LIST_HOOK_APPEND(history_policy->ec_hooks, E_CLIENT_HOOK_ACTIVATE_DONE, _focus_policy_history_hook_cb_client_activate_done, history_policy);
    E_LIST_HOOK_APPEND(history_policy->ec_hooks, E_CLIENT_HOOK_EVAL_END, _focus_policy_history_hook_cb_client_eval_end, history_policy);
 
    // e_comp_object hooks