Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_x
Modified Files:
ecore_x_dnd.c ecore_x_window.c
Log Message:
fix valgrind complaint (bad! its a string but its not 0 byte terminated!!!
its just a data lump!).
compact the lists of child windows down based on results of scan of children.
printf--
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_x/ecore_x_dnd.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -3 -r1.31 -r1.32
--- ecore_x_dnd.c 18 Aug 2007 10:35:47 -0000 1.31
+++ ecore_x_dnd.c 5 Oct 2007 12:39:06 -0000 1.32
@@ -124,8 +124,9 @@
if (!data || !size)
return 0;
- if (!(mystr = strdup(data)))
- return 0;
+ mystr = calloc(1, size + 1);
+ if (!mystr) return 0;
+ memcpy(mystr, data, size);
if (XmbTextListToTextProperty(_ecore_x_disp, &mystr, 1, style, &text_prop)
== Success)
{
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_x/ecore_x_window.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -3 -r1.54 -r1.55
--- ecore_x_window.c 5 Oct 2007 12:24:32 -0000 1.54
+++ ecore_x_window.c 5 Oct 2007 12:39:06 -0000 1.55
@@ -729,12 +729,11 @@
{
Window *list = NULL;
Window parent_win = 0, root_win = 0;
- int i;
+ int i, j;
unsigned int num;
- Shadow *s;
+ Shadow *s, **sl;
XWindowAttributes att;
- printf("_ecore_x_window_tree_walk(%x)\n", win);
if (!XGetWindowAttributes(_ecore_x_disp, win, &att)) return NULL;
// if (att.class == InputOnly) return NULL;
if (att.map_state != IsViewable) return NULL;
@@ -755,9 +754,30 @@
s->children_num = num;
for (i = 0; i < num; i++)
s->children[i] = _ecore_x_window_tree_walk(list[i]);
+ /* compress list down */
+ j = 0;
+ for (i = 0; i < num; i++)
+ {
+ if (s->children[i])
+ {
+ s->children[j] = s->children[i];
+ j++;
+ }
+ }
+ if (j == 0)
+ {
+ free(s->children);
+ s->children = NULL;
+ s->children_num = 0;
+ }
+ else
+ {
+ s->children_num = j;
+ sl = realloc(s->children, sizeof(Shadow *) * j);
+ if (sl) s->children = sl;
+ }
}
}
- printf("ADD SHADOW %x %ix%i %i %i\n", s->win, s->w, s->h, s->x, s->y);
return s;
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs