}
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;
{
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;
////////////////////////////////////////////
-
-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)
{
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);
#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;
E_Client *pec = NULL, *focusable_ec = NULL;
E_Zone *zone;
E_Desk *desk = NULL;
+ int x, y;
if (stopping) return NULL;
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 */