From: Junseok Kim Date: Tue, 11 Mar 2025 05:29:34 +0000 (+0900) Subject: e_client: unify under pointer functions to e_client_under_position_get X-Git-Tag: accepted/tizen/unified/20250317.142111~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F26%2F321126%2F1;p=platform%2Fupstream%2Fenlightenment.git e_client: unify under pointer functions to e_client_under_position_get Change-Id: I00a7e218ca572c6a0fc33b77ad82d61177866105 --- diff --git a/src/bin/core/e_client.c b/src/bin/core/e_client.c index 03aa606cf7..c257fa7c98 100644 --- a/src/bin/core/e_client.c +++ b/src/bin/core/e_client.c @@ -1825,26 +1825,7 @@ _e_client_under_pointer_helper_ignore_client(E_Desk *desk, E_Client *ec) } static E_Client * -_e_client_under_pointer_helper(E_Desk *desk, E_Client *exclude, int x, int y) -{ - E_Client *ec = NULL, *cec; - - E_CLIENT_REVERSE_FOREACH(cec) - { - if (_e_client_under_pointer_helper_ignore_client(desk, cec)) continue; - if ((exclude) && (cec == exclude)) continue; - if (!E_INSIDE(x, y, cec->x, cec->y, cec->w, cec->h)) - continue; - /* If the layer is higher, the position of the window is higher - * (always on top vs always below) */ - if (!ec || (cec->layer > ec->layer)) - ec = cec; - } - return ec; -} - -static E_Client * -_e_client_under_pointer_input_helper(E_Desk *desk, int x, int y) +_e_client_under_pointer_input_helper(E_Desk *desk, int x, int y, E_Client *exclude_ec) { E_Client *ec = NULL, *cec; @@ -1852,6 +1833,7 @@ _e_client_under_pointer_input_helper(E_Desk *desk, int x, int y) { Eina_Bool ignore_client = _e_client_under_pointer_helper_ignore_client(desk, cec); if (ignore_client) continue; + if ((exclude_ec) && (cec == exclude_ec)) continue; Eina_List *list = NULL; Eina_Rectangle *rect; @@ -5101,55 +5083,22 @@ e_client_resize_limit(E_Client *ec, int *w, int *h) //////////////////////////////////////////// - -EINTERN E_Client * -e_client_under_pointer_get(E_Desk *desk, E_Client *exclude) -{ - int x, y; - - /* We need to ensure that we can get the comp window for the - * zone of either the given desk or the desk of the excluded - * window, so return if neither is given */ - if (desk) - e_input_device_pointer_xy_get(NULL, &x, &y); - else if (exclude) - e_input_device_pointer_xy_get(NULL, &x, &y); - else - return NULL; - - if (!desk) - { - desk = exclude->desk; - if (!desk) - { - if (exclude->zone) - desk = e_desk_current_get(exclude->zone); - else - desk = e_desk_current_get(e_zone_current_get()); - } - } - - return desk ? _e_client_under_pointer_helper(desk, exclude, x, y) : NULL; -} - E_API E_Client *e_client_under_position_get(E_Desk *desk, int x, int y, E_Client *exclude) { if (!desk) return NULL; - return _e_client_under_pointer_helper(desk, exclude, x, y); + return _e_client_under_pointer_input_helper(desk, x, y, exclude); } E_API E_Client *e_client_under_position_input_get(E_Desk *desk, int x, int y) { if (!desk) return NULL; - return _e_client_under_pointer_input_helper(desk, x, y); + return _e_client_under_pointer_input_helper(desk, x, y, NULL); } //////////////////////////////////////////// -//////////////////////////////////////////// - E_API void e_client_redirected_set(E_Client *ec, Eina_Bool set) { diff --git a/src/bin/core/e_client_intern.h b/src/bin/core/e_client_intern.h index 0ae42c9570..048fc3b4d5 100644 --- a/src/bin/core/e_client_intern.h +++ b/src/bin/core/e_client_intern.h @@ -133,7 +133,6 @@ EINTERN void e_client_signal_move_end(E_Client *ec, const char *sig EINA_UN EINTERN void e_client_signal_resize_begin(E_Client *ec, const char *dir, const char *sig, const char *src EINA_UNUSED); EINTERN void e_client_signal_resize_end(E_Client *ec, const char *dir EINA_UNUSED, const char *sig EINA_UNUSED, const char *src EINA_UNUSED); -EINTERN E_Client *e_client_under_pointer_get(E_Desk *desk, E_Client *exclude); EINTERN E_Client *e_client_transient_child_top_get(E_Client *ec, Eina_Bool consider_focus); EINTERN Eina_Bool e_client_mapped_get(E_Client *ec); EINTERN void e_client_mapped_set(E_Client *ec, Eina_Bool set); diff --git a/src/bin/windowmgr/e_focus_policy_history.c b/src/bin/windowmgr/e_focus_policy_history.c index cd2ab110d0..94f75cfd39 100644 --- a/src/bin/windowmgr/e_focus_policy_history.c +++ b/src/bin/windowmgr/e_focus_policy_history.c @@ -9,6 +9,7 @@ #include "e_policy_zone_intern.h" #include "e_comp_canvas_intern.h" #include "e_policy_intern.h" +#include "e_input_device_intern.h" typedef struct _E_Focus_Policy_History_Impl E_Focus_Policy_History; typedef struct _E_Focus_Policy_History_Client E_Focus_Policy_History_Client; @@ -342,6 +343,7 @@ _focus_policy_history_focusable_get(E_Focus_Policy_History *history_policy, E_Cl E_Client *pec = NULL, *focusable_ec = NULL; E_Zone *zone; E_Desk *desk = NULL; + int x, y; if (stopping) return NULL; @@ -357,7 +359,8 @@ _focus_policy_history_focusable_get(E_Focus_Policy_History *history_policy, E_Cl if (e_config->focus_policy == E_FOCUS_MOUSE) { // set mouse over focus - pec = e_client_under_pointer_get(desk, exclude_ec); + e_input_device_pointer_xy_get(NULL, &x, &y); + pec = e_client_under_position_get(desk, x, y, exclude_ec); if (pec) focusable_ec = pec; /* no autoraise/revert here because it's probably annoying */