e_comp_wl: remove E_CLIENT_HOOK_FOCUS_UNSET callback function 56/323556/1
authorSooChan Lim <sc1.lim@samsung.com>
Fri, 11 Apr 2025 00:34:51 +0000 (09:34 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 30 Apr 2025 04:17:30 +0000 (13:17 +0900)
The focus policy is done at client_focus_unset signal callback in e_polcy_zone.c

Change-Id: I0a57f2898baa81b528b7ae5eb5186a1ad8a8543a

src/bin/server/e_comp_wl.c
src/bin/windowmgr/e_policy_zone.c

index 1007169cee2718e591e23e97615b1e3c0e63f537..fda7817ef8ea085164d55f6d3653add9dccbc2be 100644 (file)
@@ -267,28 +267,6 @@ _e_comp_wl_intercept_hook_call(E_Comp_Wl_Intercept_Hook_Point hookpoint, E_Clien
    return ret;
 }
 
-
-static void
-_e_comp_wl_configure_send(E_Client *ec, Eina_Bool edges, Eina_Bool send_size)
-{
-   int w, h;
-
-   if (send_size)
-     {
-        if (e_view_client_frame_exists(e_client_view_get(ec)))
-          w = ec->client.w, h = ec->client.h;
-        else
-          w = ec->w, h = ec->h;
-     }
-   else
-     {
-        // Width and Height are -1 means that we don't consider size value
-        w = h = -1;
-     }
-
-   e_client_shell_configure_send(ec, edges * e_client_resize_edges_get(ec), w, h);
-}
-
 static void
 _e_comp_wl_focus_check(void)
 {
@@ -3444,17 +3422,6 @@ _e_comp_wl_connected_client_create(struct wl_client *client, char *name, pid_t p
    _e_comp_wl_pid_hook_call(E_COMP_WL_PID_HOOK_CONNECTED_CLIENT_CREATE, pid);
 }
 
-static void
-_e_comp_wl_client_cb_focus_unset(void *data EINA_UNUSED, E_Client *ec)
-{
-   if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_WL) return;
-
-   /* send configure */
-   _e_comp_wl_configure_send(ec, 0, 0);
-
-   _e_comp_wl_focus_check();
-}
-
 static void
 _e_comp_wl_output_info_send(E_Comp_Wl_Output *output, struct wl_resource *resource, pid_t pid, int res_w, int res_h)
 {
@@ -3786,9 +3753,6 @@ e_comp_wl_init(void)
    E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_ROTATION_CHANGE_END, _e_comp_wl_cb_client_rot_change_end, NULL);
    E_LIST_HANDLER_APPEND(handlers, E_EVENT_INPUT_TOUCH_FRAME, _e_comp_wl_cb_touch_frame, NULL);
 
-   /* add hooks to catch e_client events */
-   E_LIST_HOOK_APPEND(hooks, E_CLIENT_HOOK_FOCUS_UNSET,  _e_comp_wl_client_cb_focus_unset,  NULL);
-
    TRACE_DS_END();
 
    return comp_wl;
index 1d557ee04d6eedabea625d2d93f12146a742807e..6421c443e5077a6ee2888adf3d6acfd11f83f9a6 100644 (file)
@@ -93,6 +93,7 @@ struct _E_Policy_Zone_Private_Client
    struct wl_listener client_destroy;
    struct wl_listener client_eval_post_new_client;
    struct wl_listener client_focus_set;
+   struct wl_listener client_focus_unset;
    struct wl_listener client_above_get;               // from e_client
    struct wl_listener client_below_get;               // from e_client
    struct wl_listener client_visible_above_get;       // from e_client
@@ -978,6 +979,22 @@ _policy_zone_cb_client_focus_set(struct wl_listener *listener, void *data)
    e_client_shell_configure_send(ec, 0, -1, -1);
 }
 
+static void
+_policy_zone_cb_client_focus_unset(struct wl_listener *listener, void *data)
+{
+   E_Policy_Zone_Private_Client *zone_client;
+   E_Client *ec;
+
+   zone_client = wl_container_of(listener, zone_client, client_focus_unset);
+   ec = zone_client->ec;
+
+   // width and height are -1 means that we don't consider size value
+   e_client_shell_configure_send(ec, 0, -1, -1);
+
+   // check the focus???
+   e_comp_wl_focus_check();
+}
+
 static void
 _policy_zone_client_cb_client_above_get(struct wl_listener *listener, void *data)
 {
@@ -1168,6 +1185,8 @@ _e_policy_zone_private_client_new(E_Policy_Zone *policy_zone, E_Client *ec)
    e_client_eval_post_new_client_listener_add(ec, &zone_client->client_eval_post_new_client);
    zone_client->client_focus_set.notify = _policy_zone_cb_client_focus_set;
    e_client_focus_set_listener_add(ec, &zone_client->client_focus_set);
+   zone_client->client_focus_unset.notify = _policy_zone_cb_client_focus_unset;
+   e_client_focus_unset_listener_add(ec, &zone_client->client_focus_unset);
    zone_client->client_above_get.notify = _policy_zone_client_cb_client_above_get;
    e_client_get_above_listener_add(ec, &zone_client->client_above_get);
    zone_client->client_below_get.notify = _policy_zone_client_cb_client_below_get;