Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_x/xlib
Modified Files:
ecore_x_netwm.c
Log Message:
ignore unkown atom types
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ecore_x_netwm.c 23 Jul 2008 10:00:01 -0000 1.1
+++ ecore_x_netwm.c 23 Jul 2008 20:58:47 -0000 1.2
@@ -847,8 +847,8 @@
EAPI int
ecore_x_netwm_window_types_get(Ecore_X_Window win, Ecore_X_Window_Type **types)
{
- int num, i;
- Ecore_X_Atom *atoms = NULL;
+ int num, i, j, numret;
+ Ecore_X_Atom *atoms = NULL, *atoms2 = NULL;
if (types) *types = NULL;
num = ecore_x_window_prop_atom_list_get(win,
@@ -859,11 +859,27 @@
if (atoms) free(atoms);
return 0;
}
+ numret = 0;
for (i = 0; i < num; i++)
- atoms[i] = _ecore_x_netwm_window_type_type_get(atoms[i]);
- if (types) *types = atoms;
- else free(atoms);
- return num;
+ {
+ atoms[i] = _ecore_x_netwm_window_type_type_get(atoms[i]);
+ if (atoms[i] != 0) numret++;
+ }
+ if (numret == 0) return 0;
+ atoms2 = malloc(numret * sizeof(Ecore_X_Window_Type));
+ if (!atoms2) return 0;
+ for (j = 0, i = 0; i < num; i++)
+ {
+ if (atoms[i] != 0)
+ {
+ atoms2[j] = atoms[i];
+ j++;
+ }
+ }
+ free(atoms);
+ if (types) *types = atoms2;
+ else free(atoms2);
+ return numret;
}
static Ecore_X_Atom
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs