make this more portable in case the number of states changes in the future, also outdent and make function params more explicit

SVN revision: 55727
This commit is contained in:
Mike Blumenkrantz 2010-12-23 00:36:53 +00:00
parent e82e4a3f2b
commit 2e647df117
1 changed files with 7 additions and 9 deletions

View File

@ -1432,18 +1432,16 @@ e_hints_window_e_state_get(E_Border *bd)
{
/* Remember to update the count if we add more states! */
Ecore_X_Atom state[1];
int num;
int num, i;
memset(state, 0, sizeof(state));
num = ecore_x_window_prop_card32_get(bd->client.win, E_ATOM_WINDOW_STATE, state, 1);
if (num)
num = ecore_x_window_prop_card32_get(bd->client.win, E_ATOM_WINDOW_STATE, state, sizeof(state));
if (!num) return;
for (i = 0; (i < num) && (i < sizeof(state)); i++)
{
int i;
for (i = 0; i < num; i++)
{
if (state[i] == E_ATOM_WINDOW_STATE_CENTERED)
bd->client.e.state.centered = 1;
}
if (state[i] == E_ATOM_WINDOW_STATE_CENTERED)
bd->client.e.state.centered = 1;
}
}