This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository enlightenment.

View the commit online.

commit e3d9dbddd3072b13defa4fec55c4e3e65c9edec2
Author: Carsten Haitzler <ras...@rasterman.com>
AuthorDate: Mon Feb 10 14:08:28 2025 +0000

    shape input - use new event regions ofr shaped input regions
    
    fixes input events on things like cairo-dock
    
    @fix
---
 src/bin/e_comp.c        |  1 +
 src/bin/e_comp_object.c | 46 +++++++++++++++++++++++++++++++++++++++
 src/bin/e_comp_object.h |  1 +
 src/bin/e_comp_x.c      | 57 +++++++++++++++++++++++++++++++++++++++++++------
 4 files changed, 99 insertions(+), 6 deletions(-)

diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c
index 541fd4b18..035ebeeee 100644
--- a/src/bin/e_comp.c
+++ b/src/bin/e_comp.c
@@ -875,6 +875,7 @@ _e_comp_shapes_update_comp_client_shape_comp_helper(E_Client *ec, Eina_Tiler *tb
           {
              x = rect->x, y = rect->y, w = rect->w, h = rect->h;
              x += ec->client.x, y += ec->client.y;
+//             printf("SHP: xxx sub %i %i    %ix%i\n", x, y, w, h);
              E_RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, e_comp->w, e_comp->h);
              if ((w < 1) || (h < 1)) continue;
    //#ifdef SHAPE_DEBUG not sure we can shape check these?
diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c
index c655876d6..d479230ee 100644
--- a/src/bin/e_comp_object.c
+++ b/src/bin/e_comp_object.c
@@ -2510,6 +2510,7 @@ _e_comp_object_input_rect_update(E_Comp_Object *cw)
      {
         o = eina_array_data_get(cw->input_objs, i++);
         x = rect->x, y = rect->y, w = rect->w, h = rect->h;
+       printf("SHP: yyy %i %i %ix%i\n", x, y, w, h);
 
         E_RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0,
                              cw->ec->client.w, cw->ec->client.h);
@@ -3268,6 +3269,7 @@ e_comp_object_input_area_set(Evas_Object *obj, const Eina_Tiler *area)
    API_ENTRY;
 
    if ((!area) && (!cw->input_area)) return;
+  printf("SHP: e_comp_object_input_area_set %p %p\n", obj, area);
    if (area && cw->input_area && eina_tiler_equal(area, cw->input_area)) return;
    _e_comp_input_objs_free(cw);
    if (cw->obj) evas_object_pass_events_set(cw->obj, 1);
@@ -3291,6 +3293,7 @@ e_comp_object_input_area_set(Evas_Object *obj, const Eina_Tiler *area)
      {
         Evas_Object *o = evas_object_rectangle_add(e_comp->evas);
         //e_util_size_debug_set(o, 1);
+  printf("SHP: ZZZZZZZZZ add input rect to %p\n", obj);
         evas_object_name_set(o, "cw->input_rect");
         evas_object_color_set(o, 0, 0, 0, 0);
         evas_object_clip_set(o, cw->clip);
@@ -4924,3 +4927,46 @@ e_comp_object_frame_volume_get(Evas_Object *obj)
    API_ENTRY NULL;
    return cw->frame_volume;
 }
+
+E_API void
+e_comp_object_shape_input_update(Evas_Object *obj)
+{
+  E_Client *ec;
+
+  API_ENTRY;
+
+  ec = cw->ec;
+  if ((ec->shaped_input) && (ec->shape_input_rects))
+    {
+      Eina_Rect *rects;
+
+      rects = malloc((ec->shape_input_rects_num + 1) * sizeof(Eina_Rect));
+      if (rects)
+        {
+          unsigned int i;
+
+          evas_object_pass_events_set(cw->obj, EINA_TRUE);
+//          printf("SHP: XXXXX [%p] [%s]\n", cw->obj, evas_object_type_get(cw->obj));
+          for (i = 0; i < ec->shape_input_rects_num; i++)
+            {
+              rects[i].x = ec->shape_input_rects[i].x;
+              rects[i].y = ec->shape_input_rects[i].y;
+              rects[i].w = ec->shape_input_rects[i].w;
+              rects[i].h = ec->shape_input_rects[i].h;
+//              printf("SHP: XXXXX %i %i %ix%i\n", rects[i].x, rects[i].y, rects[i].w, rects[i].h);
+            }
+          rects[i].x = 0;
+          rects[i].y = 0;
+          rects[i].w = 0;
+          rects[i].h = 0;
+          evas_object_event_rects_set(cw->obj, rects);
+          free(rects);
+        }
+    }
+  else
+    {
+//      printf("SHP: XXXXX [%p] [%s] RESET!!!!!\n", cw->obj, evas_object_type_get(cw->obj));
+      evas_object_pass_events_set(cw->obj, EINA_FALSE);
+      evas_object_event_rects_set(cw->obj, NULL);
+    }
+}
diff --git a/src/bin/e_comp_object.h b/src/bin/e_comp_object.h
index c055f91f9..10f4b563f 100644
--- a/src/bin/e_comp_object.h
+++ b/src/bin/e_comp_object.h
@@ -99,6 +99,7 @@ E_API void e_comp_object_effect_mover_del(E_Comp_Object_Mover *prov);
 E_API void e_comp_object_frame_volume_update(Evas_Object *obj);
 E_API Evas_Object *e_comp_object_frame_icon_get(Evas_Object *obj);
 E_API Evas_Object *e_comp_object_frame_volume_get(Evas_Object *obj);
+E_API void e_comp_object_shape_input_update(Evas_Object *obj);
 
 #endif
 #endif
diff --git a/src/bin/e_comp_x.c b/src/bin/e_comp_x.c
index f3d13d93c..01212dcf6 100644
--- a/src/bin/e_comp_x.c
+++ b/src/bin/e_comp_x.c
@@ -3404,7 +3404,18 @@ _e_comp_x_hook_client_post_new_client(void *d EINA_UNUSED, E_Client *ec)
      {
         _e_comp_x_client_shape_input_rectangle_set(ec);
         if ((!ec->shaped) && _e_comp_x_client_data_get(ec)->reparented)
-          ecore_x_window_shape_mask_set(e_client_util_pwin_get(ec), 0);
+          {
+            Ecore_X_Window pwin = e_client_util_pwin_get(ec);
+
+//            printf("SHP: shp merge 0x%x - set 0\n", pwin);
+            ecore_x_window_shape_mask_set(pwin, 0);
+            if ((ec->shaped_input) && (ec->shape_input_rects))
+              {
+//                printf("SHP: set00: 0x%x %p %i\n", pwin, (Ecore_X_Rectangle*)ec->shape_input_rects, ec->shape_input_rects_num);
+                ecore_x_window_shape_input_rectangles_set(pwin, (Ecore_X_Rectangle*)ec->shape_input_rects, ec->shape_input_rects_num);
+              }
+            e_comp_object_shape_input_update(ec->frame);
+          }
         ec->need_shape_merge = 0;
      }
 
@@ -3540,9 +3551,15 @@ _e_comp_x_hook_client_pre_frame_assign(void *d EINA_UNUSED, E_Client *ec)
    e_pixmap_parent_window_set(ep, pwin);
    ec->border.changed = 1;
    if (!ec->shaped)
-     ecore_x_window_shape_mask_set(pwin, 0);
+     {
+//       printf("SHP: not shaped zero 0x%x\n", pwin);
+       ecore_x_window_shape_mask_set(pwin, 0);
+     }
    if (ec->shaped_input)
-     ecore_x_window_shape_input_rectangles_set(pwin, (Ecore_X_Rectangle*)ec->shape_input_rects, ec->shape_input_rects_num);
+     {
+//       printf("SHP: set0: 0x%x %p %i\n", pwin, (Ecore_X_Rectangle*)ec->shape_input_rects, ec->shape_input_rects_num);
+       ecore_x_window_shape_input_rectangles_set(pwin, (Ecore_X_Rectangle*)ec->shape_input_rects, ec->shape_input_rects_num);
+     }
    ec->changes.shape = 1;
    ec->changes.shape_input = 1;
    if (ec->internal_elm_win)
@@ -3550,6 +3567,7 @@ _e_comp_x_hook_client_pre_frame_assign(void *d EINA_UNUSED, E_Client *ec)
         ecore_x_window_gravity_set(win, ECORE_X_GRAVITY_NW);
         ec->changes.reset_gravity = 1;
      }
+   e_comp_object_shape_input_update(ec->frame);
    EC_CHANGED(ec);
 
    eina_hash_add(clients_win_hash, &pwin, ec);
@@ -4412,6 +4430,7 @@ _e_comp_x_hook_client_fetch(void *d EINA_UNUSED, E_Client *ec)
                {
                   if (cd->reparented)
                     {
+//                       printf("SHP: rectangles set 0x%x %i\n", pwin, num);
                        ecore_x_window_shape_rectangles_set(pwin, rects, num);
                        if ((!ec->shaped) && (!ec->bordername))
                          {
@@ -4428,6 +4447,7 @@ _e_comp_x_hook_client_fetch(void *d EINA_UNUSED, E_Client *ec)
                   ec->changes.shape_input = 0;
                   E_FREE(ec->shape_input_rects);
                   ec->shape_input_rects_num = 0;
+                  e_comp_object_shape_input_update(ec->frame);
                }
              if (cd->reparented || (!ec->shaped))
                free(rects);
@@ -4454,7 +4474,10 @@ _e_comp_x_hook_client_fetch(void *d EINA_UNUSED, E_Client *ec)
           {
              _e_comp_x_client_shape_input_rectangle_set(ec);
              if ((!ec->shaped) && cd->reparented)
-               ecore_x_window_shape_mask_set(pwin, 0);
+               {
+//                 printf("SHP: mask set 0x%x set 0\n", pwin);
+                 ecore_x_window_shape_mask_set(pwin, 0);
+               }
           }
         ec->need_shape_merge = 1;
      }
@@ -4500,11 +4523,22 @@ _e_comp_x_hook_client_fetch(void *d EINA_UNUSED, E_Client *ec)
                {
                   ec->shaped_input = 1;
                   if (cd->reparented)
-                    ecore_x_window_shape_input_rectangles_set(pwin, rects, num);
+                    {
+//                      int ii;
+//
+//                      printf("SHP: set2: 0x%x %p %i\n", pwin, rects, num);
+//                      for (ii = 0; ii < num; ii++) printf("SHP:   %i %i   %ix%i\n",
+//                                                          rects[ii].x,
+//                                                          rects[ii].y,
+//                                                          rects[ii].width,
+//                                                          rects[ii].height);
+                      ecore_x_window_shape_input_rectangles_set(pwin, rects, num);
+                    }
                   changed = EINA_TRUE;
                   free(ec->shape_input_rects);
                   ec->shape_input_rects = (Eina_Rectangle*)rects;
                   ec->shape_input_rects_num = num;
+                  e_comp_object_shape_input_update(ec->frame);
                }
              evas_object_pass_events_set(ec->frame, ec->netwm.type == E_WINDOW_TYPE_DND);
           }
@@ -4512,12 +4546,23 @@ _e_comp_x_hook_client_fetch(void *d EINA_UNUSED, E_Client *ec)
           {
              ec->shaped_input = 1;
              if (cd->reparented)
-               ecore_x_window_shape_input_rectangles_set(pwin, rects, num);
+               {
+//                 int ii;
+//
+//                 printf("SHP: set3: 0x%x %p %i\n", pwin, rects, num);
+//                 for (ii = 0; ii < num; ii++) printf("SHP:   %i %i   %ix%i\n",
+//                                                     rects[ii].x,
+//                                                     rects[ii].y,
+//                                                     rects[ii].width,
+//                                                     rects[ii].height);
+                 ecore_x_window_shape_input_rectangles_set(pwin, rects, num);
+               }
              changed = EINA_TRUE;
              evas_object_pass_events_set(ec->frame, 1);
              free(ec->shape_input_rects);
              ec->shape_input_rects = NULL;
              ec->shape_input_rects_num = 0;
+             e_comp_object_shape_input_update(ec->frame);
           }
         if (changed || (pshaped != ec->shaped_input))
           {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to