forked from enlightenment/efl
actually just handle datatype properly.
SVN revision: 35195
This commit is contained in:
parent
4eacb3e2cd
commit
7c4a4bae8e
|
@ -847,8 +847,9 @@ ecore_x_netwm_window_type_get(Ecore_X_Window win, Ecore_X_Window_Type *type)
|
||||||
EAPI int
|
EAPI int
|
||||||
ecore_x_netwm_window_types_get(Ecore_X_Window win, Ecore_X_Window_Type **types)
|
ecore_x_netwm_window_types_get(Ecore_X_Window win, Ecore_X_Window_Type **types)
|
||||||
{
|
{
|
||||||
int num, i, j, numret;
|
int num, i;
|
||||||
Ecore_X_Atom *atoms = NULL, *atoms2 = NULL;
|
Ecore_X_Atom *atoms = NULL;
|
||||||
|
Ecore_X_Window_Type *atoms2 = NULL;
|
||||||
|
|
||||||
if (types) *types = NULL;
|
if (types) *types = NULL;
|
||||||
num = ecore_x_window_prop_atom_list_get(win,
|
num = ecore_x_window_prop_atom_list_get(win,
|
||||||
|
@ -859,27 +860,14 @@ ecore_x_netwm_window_types_get(Ecore_X_Window win, Ecore_X_Window_Type **types)
|
||||||
if (atoms) free(atoms);
|
if (atoms) free(atoms);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
numret = 0;
|
atoms2 = malloc(num * sizeof(Ecore_X_Window_Type));
|
||||||
for (i = 0; i < num; i++)
|
|
||||||
{
|
|
||||||
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;
|
if (!atoms2) return 0;
|
||||||
for (j = 0, i = 0; i < num; i++)
|
for (i = 0; i < num; i++)
|
||||||
{
|
atoms2[i] = _ecore_x_netwm_window_type_type_get(atoms[i]);
|
||||||
if (atoms[i] != 0)
|
|
||||||
{
|
|
||||||
atoms2[j] = atoms[i];
|
|
||||||
j++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
free(atoms);
|
free(atoms);
|
||||||
if (types) *types = atoms2;
|
if (types) *types = atoms2;
|
||||||
else free(atoms2);
|
else free(atoms2);
|
||||||
return numret;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Ecore_X_Atom
|
static Ecore_X_Atom
|
||||||
|
|
Loading…
Reference in New Issue