e_policy_desk_area: temporary use comp->layers for client list 05/320605/1
authorJunseok Kim <juns.kim@samsung.com>
Tue, 18 Feb 2025 08:52:44 +0000 (17:52 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 5 Mar 2025 05:00:11 +0000 (14:00 +0900)
Change-Id: If5d88308cc08ecb19897a6ea4b924cdb4196a065

src/bin/core/e_desk_area.c
src/bin/windowmgr/e_policy_desk_area.c
src/include/e_comp.h

index fbaf8ed970cbad33fdf218522001d7569f7ea2ff..87ce7571d3b46cfb66691cef828305cd00627fb5 100644 (file)
@@ -3,6 +3,10 @@
 #include "e_comp_canvas_intern.h"
 #include "e_desk_intern.h"
 
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+#include "e_comp_intern.h"
+#endif
+
 #include <libds-tizen/screen.h>
 
 typedef struct _E_Desk_Area_Private         E_Desk_Area_Private;
@@ -248,7 +252,13 @@ e_desk_area_layer_object_get(E_Desk_Area *eda, E_Layer layer)
    if (!eda) return NULL;
    if (layer < E_LAYER_CLIENT_DESKTOP || layer > E_LAYER_MAX) return NULL;
 
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+   E_Comp *comp;
+   comp = e_comp_get();
+   return comp->layers[e_comp_canvas_layer_map(layer)].obj;
+#else
    return eda->layers[e_comp_canvas_layer_map(layer)].obj;
+#endif
 }
 
 
index 82a04b8b2432206c1b90791734f2485d6caf14e3..13cd9f228a67af903fbc0e2412e5ead84d2e0b91 100644 (file)
@@ -336,10 +336,28 @@ _e_policy_desk_area_cb_top_ec_get(struct wl_listener *listener, void *data)
    get_data = (E_Desk_Area_Data_EC_Get *) data;
    eda = get_data->eda;
 
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+   E_Comp *comp;
+   comp = e_comp_get();
+#endif
+
    e_comp_ec_list_lock();
 
    for (x = e_comp_canvas_layer_map(E_LAYER_CLIENT_CURSOR); x >= e_comp_canvas_layer_map(E_LAYER_CLIENT_DESKTOP); x--)
      {
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+        if (!comp->layers[x].clients) continue;
+
+        EINA_INLIST_REVERSE_FOREACH(comp->layers[x].clients, ec)
+          {
+             if (e_object_is_del(E_OBJECT(ec))) continue;
+             if (!e_desk_area_has_ec(eda, ec)) continue;
+
+             e_comp_ec_list_unlock();
+             get_data->result_ec = ec;
+             return;
+          }
+#else
         if (!eda->layers[x].clients) continue;
 
         EINA_INLIST_REVERSE_FOREACH(eda->layers[x].clients, ec)
@@ -349,6 +367,7 @@ _e_policy_desk_area_cb_top_ec_get(struct wl_listener *listener, void *data)
                  get_data->result_ec = ec;
                  return;
               }
+#endif
      }
 
    e_comp_ec_list_unlock();
@@ -368,10 +387,28 @@ _e_policy_desk_area_cb_bottom_ec_get(struct wl_listener *listener, void *data)
    get_data = (E_Desk_Area_Data_EC_Get *) data;
    eda = get_data->eda;
 
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+   E_Comp *comp;
+   comp = e_comp_get();
+#endif
+
    e_comp_ec_list_lock();
 
    for (x = e_comp_canvas_layer_map(E_LAYER_CLIENT_DESKTOP); x <= e_comp_canvas_layer_map(E_LAYER_CLIENT_CURSOR); x++)
      {
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+        if (!comp->layers[x].clients) continue;
+
+        EINA_INLIST_FOREACH(comp->layers[x].clients, ec)
+          {
+             if (e_object_is_del(E_OBJECT(ec))) continue;
+             if (!e_desk_area_has_ec(eda, ec)) continue;
+
+             e_comp_ec_list_unlock();
+             get_data->result_ec = ec;
+             return;
+          }
+#else
         if (!eda->layers[x].clients) continue;
 
         EINA_INLIST_FOREACH(eda->layers[x].clients, ec)
@@ -381,6 +418,7 @@ _e_policy_desk_area_cb_bottom_ec_get(struct wl_listener *listener, void *data)
                  get_data->result_ec = ec;
                  return;
               }
+#endif
      }
 
    e_comp_ec_list_unlock();
@@ -440,12 +478,26 @@ _desk_area_cb_client_get_above(struct wl_listener *listener, void *data)
    eda = pda->desk_area;
    ec = client_data->criterion_ec;
 
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+   E_Comp *comp;
+   comp = e_comp_get();
+#endif
+
    e_comp_ec_list_lock();
 
    if (EINA_INLIST_GET(ec)->next) //check current layer
      {
         EINA_INLIST_FOREACH(EINA_INLIST_GET(ec)->next, ec2)
           {
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+             if (ec == ec2) continue;
+             if (e_object_is_del(E_OBJECT(ec2))) continue;
+             if (!e_desk_area_has_ec(eda, ec)) continue;
+
+             client_data->result_ec = ec2;
+             e_comp_ec_list_unlock();
+             return;
+#else
              if (ec == ec2)
                {
                   ELOGF("FATAL", "CHECK the ec inlist next", ec);
@@ -457,6 +509,7 @@ _desk_area_cb_client_get_above(struct wl_listener *listener, void *data)
                   e_comp_ec_list_unlock();
                   return;
                }
+#endif
           }
      }
 
@@ -470,6 +523,25 @@ _desk_area_cb_client_get_above(struct wl_listener *listener, void *data)
    /* go up the layers until we find one */
    for (x = e_comp_canvas_layer_map(ec->layer) + 1; x <= e_comp_canvas_layer_map(E_LAYER_CLIENT_CURSOR); x++)
      {
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+        if (!comp->layers[x].clients) continue;
+
+        EINA_INLIST_FOREACH(comp->layers[x].clients, ec2)
+          {
+             if (ec == ec2)
+               {
+                  ELOGF("FATAL", "[eda:%p] EC exist above layer. ec layer_map:%d, cur layer_map:%d",
+                        ec, eda, e_comp_canvas_layer_map(ec->layer), x);
+                  continue;
+               }
+             if (e_object_is_del(E_OBJECT(ec2))) continue;
+             if (!e_desk_area_has_ec(eda, ec)) continue;
+
+             client_data->result_ec = ec2;
+             e_comp_ec_list_unlock();
+             return;
+          }
+#else
         if (!eda->layers[x].clients) continue;
 
         EINA_INLIST_FOREACH(eda->layers[x].clients, ec2)
@@ -487,6 +559,7 @@ _desk_area_cb_client_get_above(struct wl_listener *listener, void *data)
                   return;
                }
           }
+#endif
      }
 
    e_comp_ec_list_unlock();
@@ -508,6 +581,11 @@ _desk_area_cb_client_get_below(struct wl_listener *listener, void *data)
    eda = pda->desk_area;
    ec = client_data->criterion_ec;
 
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+   E_Comp *comp;
+   comp = e_comp_get();
+#endif
+
    e_comp_ec_list_lock();
 
    if (EINA_INLIST_GET(ec)->prev) //check current layer
@@ -515,6 +593,15 @@ _desk_area_cb_client_get_below(struct wl_listener *listener, void *data)
         for (l = EINA_INLIST_GET(ec)->prev; l; l = l->prev)
           {
              ec2 = EINA_INLIST_CONTAINER_GET(l, E_Client);
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+             if (ec == ec2) continue;
+             if (e_object_is_del(E_OBJECT(ec2))) continue;
+             if (!e_desk_area_has_ec(eda, ec)) continue;
+
+             client_data->result_ec = ec2;
+             e_comp_ec_list_unlock();
+             return;
+#else
              if (ec == ec2)
                {
                   ELOGF("FATAL", "CHECK the ec inlist prev", ec);
@@ -526,6 +613,7 @@ _desk_area_cb_client_get_below(struct wl_listener *listener, void *data)
                   e_comp_ec_list_unlock();
                   return;
                }
+#endif
           }
      }
 
@@ -559,6 +647,25 @@ _desk_area_cb_client_get_below(struct wl_listener *listener, void *data)
 
    for (; x >= e_comp_canvas_layer_map(E_LAYER_CLIENT_DESKTOP); x--)
      {
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+        if (!comp->layers[x].clients) continue;
+
+        EINA_INLIST_REVERSE_FOREACH(comp->layers[x].clients, ec2)
+          {
+             if (ec == ec2)
+               {
+                  ELOGF("FATAL", "[eda:%p] EC exist below layer. ec layer_map:%d, cur layer_map:%d",
+                        ec, eda, e_comp_canvas_layer_map(ec_layer), x);
+                  continue;
+               }
+             if (e_object_is_del(E_OBJECT(ec2))) continue;
+             if (!e_desk_area_has_ec(eda, ec)) continue;
+
+             client_data->result_ec = ec2;
+             e_comp_ec_list_unlock();
+             return;
+          }
+#else
         if (!eda->layers[x].clients) continue;
 
         EINA_INLIST_REVERSE_FOREACH(eda->layers[x].clients, ec2)
@@ -576,6 +683,7 @@ _desk_area_cb_client_get_below(struct wl_listener *listener, void *data)
                   return;
                }
           }
+#endif
      }
 
    e_comp_ec_list_unlock();
@@ -604,12 +712,26 @@ _desk_area_cb_client_get_visible_above(struct wl_listener *listener, void *data)
    eda = pda->desk_area;
    ec = client_data->criterion_ec;
 
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+   E_Comp *comp;
+   comp = e_comp_get();
+#endif
+
    e_comp_ec_list_lock();
 
    if (EINA_INLIST_GET(ec)->next) //check current layer
      {
         EINA_INLIST_FOREACH(EINA_INLIST_GET(ec)->next, ec2)
           {
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+             if (ec == ec2) continue;
+             if (!_desk_area_client_check_visible(ec2)) continue;
+             if (!e_desk_area_has_ec(eda, ec)) continue;
+
+             client_data->result_ec = ec2;
+             e_comp_ec_list_unlock();
+             return;
+#else
              if (ec == ec2) continue;
              if (_desk_area_client_check_visible(ec2))
                {
@@ -617,6 +739,7 @@ _desk_area_cb_client_get_visible_above(struct wl_listener *listener, void *data)
                   e_comp_ec_list_unlock();
                   return;
                }
+#endif
           }
      }
 
@@ -630,6 +753,19 @@ _desk_area_cb_client_get_visible_above(struct wl_listener *listener, void *data)
    /* go up the layers until we find one */
    for (x = e_comp_canvas_layer_map(ec->layer) + 1; x <= e_comp_canvas_layer_map(E_LAYER_CLIENT_CURSOR); x++)
      {
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+        if (!comp->layers[x].clients) continue;
+        EINA_INLIST_FOREACH(comp->layers[x].clients, ec2)
+          {
+             if (ec == ec2) continue;
+             if (!_desk_area_client_check_visible(ec2)) continue;
+             if (!e_desk_area_has_ec(eda, ec)) continue;
+
+             client_data->result_ec = ec2;
+             e_comp_ec_list_unlock();
+             return;
+          }
+#else
         if (!eda->layers[x].clients) continue;
         EINA_INLIST_FOREACH(eda->layers[x].clients, ec2)
           {
@@ -641,6 +777,7 @@ _desk_area_cb_client_get_visible_above(struct wl_listener *listener, void *data)
                   return;
                }
           }
+#endif
      }
 
    e_comp_ec_list_unlock();
@@ -662,6 +799,11 @@ _desk_area_cb_client_get_visible_below(struct wl_listener *listener, void *data)
    eda = pda->desk_area;
    ec = client_data->criterion_ec;
 
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+   E_Comp *comp;
+   comp = e_comp_get();
+#endif
+
    e_comp_ec_list_lock();
 
    if (EINA_INLIST_GET(ec)->prev) //check current layer
@@ -669,6 +811,15 @@ _desk_area_cb_client_get_visible_below(struct wl_listener *listener, void *data)
         for (l = EINA_INLIST_GET(ec)->prev; l; l = l->prev)
           {
              ec2 = EINA_INLIST_CONTAINER_GET(l, E_Client);
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+             if (ec == ec2) continue;
+             if (!_desk_area_client_check_visible(ec2)) continue;
+             if (!e_desk_area_has_ec(eda, ec)) continue;
+
+             client_data->result_ec = ec2;
+             e_comp_ec_list_unlock();
+             return;
+#else
              if (ec == ec2) continue;
              if (_desk_area_client_check_visible(ec2))
                {
@@ -676,6 +827,7 @@ _desk_area_cb_client_get_visible_below(struct wl_listener *listener, void *data)
                   e_comp_ec_list_unlock();
                   return;
                }
+#endif
           }
      }
 
@@ -703,8 +855,23 @@ _desk_area_cb_client_get_visible_below(struct wl_listener *listener, void *data)
    x = e_comp_canvas_layer_map(ec->layer);
    if (x > 0) x--;
 
+   e_comp_ec_list_lock();
+
    for (; x >= e_comp_canvas_layer_map(E_LAYER_CLIENT_DESKTOP); x--)
      {
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+        if (!comp->layers[x].clients) continue;
+        EINA_INLIST_REVERSE_FOREACH(comp->layers[x].clients, ec2)
+          {
+             if (ec == ec2) continue;
+             if (!_desk_area_client_check_visible(ec2)) continue;
+             if (!e_desk_area_has_ec(eda, ec)) continue;
+
+             client_data->result_ec = ec2;
+             e_comp_ec_list_unlock();
+             return;
+          }
+#else
         if (!eda->layers[x].clients) continue;
         EINA_INLIST_REVERSE_FOREACH(eda->layers[x].clients, ec2)
           {
@@ -712,10 +879,14 @@ _desk_area_cb_client_get_visible_below(struct wl_listener *listener, void *data)
              if (_desk_area_client_check_visible(ec2))
                {
                   client_data->result_ec = ec2;
+                  e_comp_ec_list_unlock();
                   return;
                }
           }
+#endif
      }
+
+   e_comp_ec_list_unlock();
 }
 
 static void
@@ -1824,8 +1995,41 @@ _e_comp_object_layers_update(unsigned int layer, E_Comp_Input_Inlist_Function_Ty
 static void
 _e_comp_object_layers_add(E_Desk_Area *eda, E_Comp_Object *cw, E_Comp_Object *above, E_Comp_Object *below, Eina_Bool prepend)
 {
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+   E_Comp *comp;
+   comp = e_comp_get();
+#endif
+
    e_comp_ec_list_lock();
 
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+   if (above)
+     {
+        comp->layers[above->layer].clients = eina_inlist_append_relative(comp->layers[above->layer].clients, EINA_INLIST_GET(cw->ec), EINA_INLIST_GET(above->ec));
+        comp->layers[above->layer].clients_count++;
+        _e_comp_object_layers_update(above->layer, E_COMP_INPUT_INLIST_APPEND_RELATIVE, cw->ec, above->ec);
+     }
+   else if (below)
+     {
+        comp->layers[below->layer].clients = eina_inlist_prepend_relative(comp->layers[below->layer].clients, EINA_INLIST_GET(cw->ec), EINA_INLIST_GET(below->ec));
+        comp->layers[below->layer].clients_count++;
+        _e_comp_object_layers_update(below->layer, E_COMP_INPUT_INLIST_PREPEND_RELATIVE, cw->ec, below->ec);
+     }
+   else
+     {
+        if (prepend)
+          {
+             comp->layers[cw->layer].clients = eina_inlist_prepend(comp->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec));
+             _e_comp_object_layers_update(cw->layer, E_COMP_INPUT_INLIST_PREPEND, cw->ec, NULL);
+          }
+        else //this is either the layer object or a tough actin tinactin^W^W^Wfast stacking client
+          {
+             comp->layers[cw->layer].clients = eina_inlist_append(comp->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec));
+             _e_comp_object_layers_update(cw->layer, E_COMP_INPUT_INLIST_APPEND, cw->ec, NULL);
+          }
+        comp->layers[cw->layer].clients_count++;
+     }
+#else
    if (above)
      {
         eda->layers[above->layer].clients = eina_inlist_append_relative(eda->layers[above->layer].clients, EINA_INLIST_GET(cw->ec), EINA_INLIST_GET(above->ec));
@@ -1852,6 +2056,7 @@ _e_comp_object_layers_add(E_Desk_Area *eda, E_Comp_Object *cw, E_Comp_Object *ab
           }
         eda->layers[cw->layer].clients_count++;
      }
+#endif
 
    e_comp_ec_list_unlock();
 }
@@ -1859,14 +2064,28 @@ _e_comp_object_layers_add(E_Desk_Area *eda, E_Comp_Object *cw, E_Comp_Object *ab
 static void
 _e_comp_object_layers_remove(E_Desk_Area *eda, E_Comp_Object *cw)
 {
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+   E_Comp *comp;
+   comp = e_comp_get();
+#endif
+
    e_comp_ec_list_lock();
 
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+   if (cw->ec && comp->layers[cw->layer].clients)
+     {
+        comp->layers[cw->layer].clients = eina_inlist_remove(comp->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec));
+        comp->layers[cw->layer].clients_count--;
+        _e_comp_object_layers_update(cw->layer, E_COMP_INPUT_INLIST_REMOVE, cw->ec, NULL);
+     }
+#else
    if (cw->ec && eda->layers[cw->layer].clients)
      {
         eda->layers[cw->layer].clients = eina_inlist_remove(eda->layers[cw->layer].clients, EINA_INLIST_GET(cw->ec));
         eda->layers[cw->layer].clients_count--;
         _e_comp_object_layers_update(cw->layer, E_COMP_INPUT_INLIST_REMOVE, cw->ec, NULL);
      }
+#endif
 
    e_comp_ec_list_unlock();
 }
@@ -1890,6 +2109,10 @@ _e_comp_object_layer_update(E_Desk_Area *eda, Evas_Object *obj,
    E_Comp_Object *cw, *cw2 = NULL;
    Evas_Object *o = NULL;
    short layer;
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+   E_Comp *comp;
+   comp = e_comp_get();
+#endif
 
    cw = evas_object_smart_data_get(obj);
    if (!cw) return;
@@ -1915,7 +2138,11 @@ _e_comp_object_layer_update(E_Desk_Area *eda, Evas_Object *obj,
              if ((!o) || (o == cw->smart_obj)) break;
              if (evas_object_layer_get(o) != layer)
                {
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+                  o = comp->layers[e_comp_canvas_layer_map(E_LAYER_CLIENT_ALERT)].obj;
+#else
                   o = eda->layers[e_comp_canvas_layer_map(E_LAYER_CLIENT_ALERT)].obj;
+#endif
                }
              if (!o)
                {
@@ -1957,6 +2184,10 @@ _e_comp_intercept_stack_helper(E_Desk_Area *eda, E_Comp_Object *cw, Evas_Object
    short layer;
    Evas_Object *o = stack;
    Eina_Bool raising = stack_cb == e_comp_object_stack_above;
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+   E_Comp *comp;
+   comp = e_comp_get();
+#endif
 
    /* We should consider topmost's layer_pending for subsurface */
    if ((cw->ec->layer_block) || _e_comp_object_is_pending(cw->ec))
@@ -2012,7 +2243,11 @@ _e_comp_intercept_stack_helper(E_Desk_Area *eda, E_Comp_Object *cw, Evas_Object
              /* reached the top client layer somehow
               * use top client object
               */
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+             o = comp->layers[e_comp_canvas_layer_map(E_LAYER_CLIENT_CURSOR)].obj;
+#else
              o = eda->layers[e_comp_canvas_layer_map(E_LAYER_CLIENT_CURSOR)].obj;
+#endif
           }
         if (!o)
           /* top client layer window hasn't been stacked yet. this probably shouldn't happen?
@@ -2067,7 +2302,11 @@ _e_comp_intercept_stack_helper(E_Desk_Area *eda, E_Comp_Object *cw, Evas_Object
                   /* stack it above layer object */
                   int below_layer;
                   below_layer = (cw2->layer <= 0)? 0 : cw2->layer - 1 ;
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+                  stack = comp->layers[below_layer].obj;
+#else
                   stack = eda->layers[below_layer].obj;
+#endif
                }
           }
         else
@@ -2082,7 +2321,11 @@ _e_comp_intercept_stack_helper(E_Desk_Area *eda, E_Comp_Object *cw, Evas_Object
              if ((new_stack) && (new_stack->layer == cw2->ec->layer))
                stack = new_stack->frame;
              else
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+               stack = comp->layers[cw2->layer].obj;
+#else
                stack = eda->layers[cw2->layer].obj;
+#endif
           }
      }
 
@@ -2090,8 +2333,13 @@ _e_comp_intercept_stack_helper(E_Desk_Area *eda, E_Comp_Object *cw, Evas_Object
    if (cw->ec->new_client || (!ecstack) || (ecstack->frame != o))
      evas_object_data_set(cw->smart_obj, "client_restack", (void*)1);
    stack_cb(cw->smart_obj, stack);
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+   if (comp->layers[cw->layer].obj)
+     if (evas_object_below_get(cw->smart_obj) == comp->layers[cw->layer].obj)
+#else
    if (eda->layers[cw->layer].obj)
      if (evas_object_below_get(cw->smart_obj) == eda->layers[cw->layer].obj)
+#endif
        {
           CRI("STACKING ERROR!!! ec:%p (cw->layer:%d, ec->layer:%d)", cw->ec, cw->layer, cw->ec->layer);
        }
@@ -2151,6 +2399,10 @@ _desk_area_cb_comp_object_raise(struct wl_listener *listener, void *data)
    E_Client *ec;
    Evas_Object *obj, *o, *op;
    E_Comp_Object *cw;
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+   E_Comp *comp;
+   comp = e_comp_get();
+#endif
 
    eda_client = wl_container_of(listener, eda_client, comp_object_raise);
    eda = eda_client->eda;
@@ -2175,9 +2427,15 @@ _desk_area_cb_comp_object_raise(struct wl_listener *listener, void *data)
    if (evas_object_layer_get(o) != evas_object_layer_get(obj)) return; //already at top!
 
    /* still stack below override below the layer marker */
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+   for (op = o = comp->layers[cw->layer].obj;
+        o && o != comp->layers[cw->layer - 1].obj;
+        op = o, o = evas_object_below_get(o))
+#else
    for (op = o = eda->layers[cw->layer].obj;
         o && o != eda->layers[cw->layer - 1].obj;
         op = o, o = evas_object_below_get(o))
+#endif
      {
         if (evas_object_smart_smart_get(o))
           {
@@ -2208,6 +2466,10 @@ _desk_area_cb_comp_object_set_layer(struct wl_listener *listener, void *data)
    E_Comp_Wl_Client_Data *child_cdata;
    unsigned int l;
    int oldraise;
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+   E_Comp *comp;
+   comp = e_comp_get();
+#endif
 
    eda_client = wl_container_of(listener, eda_client, comp_object_set_layer);
    eda = eda_client->eda;
@@ -2259,7 +2521,11 @@ _desk_area_cb_comp_object_set_layer(struct wl_listener *listener, void *data)
                     evas_object_stack_below(obj, ec2->frame);
                }
              else
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+               evas_object_stack_below(obj, ec2 ? ec2->frame : comp->layers[cw->layer].obj);
+#else
                evas_object_stack_below(obj, ec2 ? ec2->frame : eda->layers[cw->layer].obj);
+#endif
           }
         return;
      }
@@ -2310,9 +2576,15 @@ layer_set:
    //if (cw->ec->new_client)
      //INF("CLIENT STACKED %p: %u", cw->ec, layer);
    e_comp_object_layer_set(obj, layer);
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+   if (!comp->layers[cw->layer].obj) return; //this is a layer marker
+   evas_object_stack_below(obj, comp->layers[cw->layer].obj);
+   if (evas_object_below_get(obj) == comp->layers[cw->layer].obj)
+#else
    if (!eda->layers[cw->layer].obj) return; //this is a layer marker
    evas_object_stack_below(obj, eda->layers[cw->layer].obj);
    if (evas_object_below_get(obj) == eda->layers[cw->layer].obj)
+#endif
      {
         /* can't stack a client above its own layer marker */
         CRI("STACKING ERROR!!! ec:%p (cw->layer:%d, ec->layer:%d)", cw->ec, cw->layer, cw->ec->layer);
@@ -2699,6 +2971,10 @@ e_policy_desk_area_new(E_Desk_Area *eda)
    E_Policy_Desk_Area *pda;
    E_Layer ec_layer;
    Evas_Object *obj;
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+   E_Comp *comp;
+   comp = e_comp_get();
+#endif
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(eda, NULL);
 
@@ -2722,7 +2998,11 @@ e_policy_desk_area_new(E_Desk_Area *eda)
    for (ec_layer = e_comp_canvas_layer_map(E_LAYER_CLIENT_DESKTOP); ec_layer <= e_comp_canvas_layer_map(E_LAYER_CLIENT_CURSOR); ec_layer++)
      {
 
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+        obj = comp->layers[ec_layer].obj = evas_object_rectangle_add(e_comp_evas_get());
+#else
         obj = eda->layers[ec_layer].obj = evas_object_rectangle_add(e_comp_evas_get());
+#endif
         evas_object_layer_set(obj, e_comp_canvas_layer_map_to(ec_layer));
         evas_object_name_set(obj, "layer_obj");
      }
index d04168464b3984033550ff6e4cee8295d0865ef3..669fc06073896a553717f7be7fbe143b5e9fcdd1 100644 (file)
@@ -27,6 +27,8 @@ using namespace std;
 # define E_COMP_TYPE (int) 0xE0b01003
 # define E_CLIENT_LAYER_COUNT 19
 
+#define NEED_REFINE_EDA_LAYERS_LIST
+
 typedef struct _E_Comp                       E_Comp;
 typedef struct _E_Comp_Wl_Client_Data        E_Comp_Client_Data;  // deprecated. use E_Comp_Wl_Client_Data intead of this.
 typedef struct _E_Comp_Wl_Data               E_Comp_Wl_Data;
@@ -144,6 +146,14 @@ struct _E_Comp
    } commit_handler_timer;
 
    GRecMutex          ec_list_mutex;
+
+#ifdef NEED_REFINE_EDA_LAYERS_LIST
+   struct {
+      Evas_Object *obj;
+      Eina_Inlist *clients; /* E_Client, bottom to top */
+      unsigned int clients_count;
+   } layers[E_LAYER_COUNT];
+#endif
 };
 
 struct _E_Comp_Connected_Client_Info