From fd7b1e4b3796033509ea16ca13dcbbbdc0a8a834 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Thu, 24 Feb 2022 18:44:14 +0000 Subject: [PATCH] overlay resize regions - properly sety shape rects to account for them e didn't set shape rects for input overflow areas for the resize handles in theme to work on top of other clients and client areas. this should make that all work now and make the resize handle area bigger than it actually looks. @fix --- src/bin/e_comp.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++ src/bin/e_comp_x.c | 36 ++++++++++++++++++++--------- 2 files changed, 82 insertions(+), 11 deletions(-) diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c index caec70e00..ccea3ed8c 100644 --- a/src/bin/e_comp.c +++ b/src/bin/e_comp.c @@ -756,6 +756,60 @@ _e_comp_shapes_update_object_checker_function_thingy(Evas_Object *o) return EINA_FALSE; } +static Eina_Bool +_tiler_obj_visible(Evas_Object *o) +{ + Evas_Object *o2; + + if (!evas_object_visible_get(o)) return EINA_FALSE; + o2 = evas_object_clip_get(o); + if (!o2) return EINA_TRUE; + return _tiler_obj_visible(o2); +} + +static void +_tiler_add_input_sub(Evas_Object *par, Eina_Tiler *tb) +{ + Eina_List *objs = evas_object_smart_members_get(par); + Evas_Coord x, y, w, h; + Evas_Object *o; + const char *type; + void *sd; + + EINA_LIST_FREE(objs, o) + { + if ((_tiler_obj_visible(o)) && + (!evas_object_pass_events_get(o))) + { + type = evas_object_type_get(o); + + if (type) + { + if (!strcmp(type, "rectangle")) + { + if (!evas_object_clipees_has(o)) + { + evas_object_geometry_get(o, &x, &y, &w, &h); + eina_tiler_rect_add(tb, &(Eina_Rectangle){x, y, w, h}); + } + } + else if ((!strcmp(type, "image")) || + (!strcmp(type, "text")) || + (!strcmp(type, "textblock")) + ) + { + } + else if ((!strcmp(type, "edje")) || + (!strcmp(type, "e_zoomap"))) + { + sd = evas_object_smart_data_get(o); + if (sd) _tiler_add_input_sub(o, tb); + } + } + } + } +} + static void _e_comp_shapes_update_comp_client_shape_comp_helper(E_Client *ec, Eina_Tiler *tb, Eina_List **rl) { @@ -823,6 +877,7 @@ _e_comp_shapes_update_comp_client_shape_comp_helper(E_Client *ec, Eina_Tiler *tb eina_tiler_rect_del(tb, &(Eina_Rectangle){x, y, w, h}); SHAPE_INF("DEL: %d,%d@%dx%d", x, y, w, h); } + _tiler_add_input_sub(ec->frame, tb); return; } @@ -849,6 +904,8 @@ _e_comp_shapes_update_comp_client_shape_comp_helper(E_Client *ec, Eina_Tiler *tb eina_tiler_rect_del(tb, &(Eina_Rectangle){ec->client.x, ec->client.y, ec->client.w, ec->client.h}); SHAPE_INF("DEL: %d,%d@%dx%d", ec->client.x, ec->client.y, ec->client.w, ec->client.h); } + + _tiler_add_input_sub(ec->frame, tb); } static void diff --git a/src/bin/e_comp_x.c b/src/bin/e_comp_x.c index ae8a05233..04aaa1a62 100644 --- a/src/bin/e_comp_x.c +++ b/src/bin/e_comp_x.c @@ -2606,29 +2606,43 @@ _e_comp_x_mouse_in_job(void *d EINA_UNUSED) mouse_in_job = NULL; } +static E_Client * +_e_comp_x_e_client_obj_get(Evas_Object *o) +{ + Evas_Object *par; + + if (evas_object_data_get(o, "comp_object")) + return e_comp_object_client_get(o); + par = evas_object_smart_parent_get(o); + if (!par) return NULL; + return _e_comp_x_e_client_obj_get(par); +} + static Eina_Bool _e_comp_x_mouse_in_fix_check_timer_cb(void *data EINA_UNUSED) { E_Client *ec = NULL, *cec; + Eina_List *l, *in_list; + Evas_Object *o; int x, y; mouse_in_fix_check_timer = NULL; if (e_grabinput_key_win_get() || e_grabinput_mouse_win_get()) return EINA_FALSE; ecore_evas_pointer_xy_get(e_comp->ee, &x, &y); - E_CLIENT_REVERSE_FOREACH(cec) + + in_list = evas_tree_objects_at_xy_get(e_comp->evas, NULL, x, y); + EINA_LIST_FOREACH(in_list, l, o) { - /* If a border was specified which should be excluded from the list - * (because it will be closed shortly for example), skip */ - if ((!e_client_util_desk_visible(cec, e_desk_current_get(e_zone_current_get())))) continue; - if (!evas_object_visible_get(cec->frame)) 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; + ec = _e_comp_x_e_client_obj_get(o); + if (ec) + { + if ((!e_client_util_desk_visible + (ec, e_desk_current_get(e_zone_current_get())))) continue; + break; + } } + eina_list_free(in_list); if (ec) { mouse_client = ec;