Keep track of number of clients.
authorsebastid <sebastid>
Tue, 8 Aug 2006 01:34:49 +0000 (01:34 +0000)
committersebastid <sebastid@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 8 Aug 2006 01:34:49 +0000 (01:34 +0000)
SVN revision: 24457

src/bin/e_container.c
src/bin/e_container.h

index fbacc47..c899254 100644 (file)
@@ -564,14 +564,7 @@ e_container_shape_solid_rect_get(E_Container_Shape *es, int *x, int *y, int *w,
 EAPI int
 e_container_borders_count(E_Container *con)
 {
-   /* FIXME: This could be stored and not calculated */
-   int num, i;
-
-   num = 0;
-   for (i = 0; i < num; i++)
-     num += evas_list_count(con->layers[i].clients);
-
-   return num;
+   return con->clients;
 }
 
 EAPI void
@@ -586,6 +579,7 @@ e_container_border_add(E_Border *bd)
    else if ((bd->layer > 150) && (bd->layer <= 200)) pos = 4;
    else pos = 5;
 
+   bd->zone->container->clients++;
    bd->zone->container->layers[pos].clients =
       evas_list_append(bd->zone->container->layers[pos].clients, bd);
 }
@@ -597,6 +591,7 @@ e_container_border_remove(E_Border *bd)
 
    /* FIXME: Could revert to old behaviour, ->layer is consistent
     * with pos now. */
+   bd->zone->container->clients--;
    for (i = 0; i < 7; i++)
      {
        bd->zone->container->layers[i].clients =
index e35adba..d519c5c 100644 (file)
@@ -50,6 +50,7 @@ struct _E_Container
    Evas_List           *shape_change_cb;
    Evas_List           *zones;
 
+   unsigned int clients;
    struct {
       Ecore_X_Window win;
       Evas_List *clients;