add debug/error catching

SVN revision: 25081
This commit is contained in:
Carsten Haitzler 2006-08-23 23:24:23 +00:00
parent 2fc4d7d945
commit 88092a49bf
1 changed files with 24 additions and 6 deletions

View File

@ -291,12 +291,11 @@ e_hints_client_stacking_set(void)
} }
} }
clients = calloc(num, sizeof(Ecore_X_Window));
if (!clients)
return;
if (num > 0) if (num > 0)
{ {
clients = calloc(num, sizeof(Ecore_X_Window));
if (!clients) return;
for (ml = e_manager_list(); ml; ml = ml->next) for (ml = e_manager_list(); ml; ml = ml->next)
{ {
m = ml->data; m = ml->data;
@ -305,15 +304,35 @@ e_hints_client_stacking_set(void)
c = cl->data; c = cl->data;
bl = e_container_border_list_first(c); bl = e_container_border_list_first(c);
while ((b = e_container_border_list_next(bl))) while ((b = e_container_border_list_next(bl)))
clients[i++] = b->win; {
if (i >= num)
{
e_error_message_show("e_hints.c: e_hints_client_stacking_set()<br>"
"<br>"
"Window list size greater than window count.<br>"
"This is really bad.<br>"
"Please report this.");
break;
}
clients[i++] = b->win;
}
e_container_border_list_free(bl); e_container_border_list_free(bl);
} }
} }
if (i < num)
{
e_error_message_show("e_hints.c: e_hints_client_stacking_set()<br>"
"<br>"
"Window list size less than window count.<br>"
"This is strange, but not harmful.<br>"
"Please report this.");
}
for (ml = e_manager_list(); ml; ml = ml->next) for (ml = e_manager_list(); ml; ml = ml->next)
{ {
m = ml->data; m = ml->data;
ecore_x_netwm_client_list_stacking_set(m->root, clients, num); ecore_x_netwm_client_list_stacking_set(m->root, clients, num);
} }
E_FREE(clients);
} }
else else
{ {
@ -323,7 +342,6 @@ e_hints_client_stacking_set(void)
ecore_x_netwm_client_list_stacking_set(m->root, NULL, 0); ecore_x_netwm_client_list_stacking_set(m->root, NULL, 0);
} }
} }
E_FREE(clients);
} }
EAPI void EAPI void