ewmh: fix bug with recent xcb-proto

The len is the real len is byte, not the number of elements.

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-08-19 16:40:16 +02:00
parent cb2cad6b09
commit 98953ed6f1
1 changed files with 2 additions and 2 deletions

4
ewmh.c
View File

@ -538,7 +538,7 @@ ewmh_client_check_hints(client_t *c)
if(reply && (data = xcb_get_property_value(reply))) if(reply && (data = xcb_get_property_value(reply)))
{ {
state = (xcb_atom_t *) data; state = (xcb_atom_t *) data;
for(int i = 0; i < xcb_get_property_value_length(reply); i++) for(int i = 0; i < xcb_get_property_value_length(reply) / ssizeof(xcb_atom_t); i++)
ewmh_process_state_atom(c, state[i], _NET_WM_STATE_ADD); ewmh_process_state_atom(c, state[i], _NET_WM_STATE_ADD);
} }
@ -548,7 +548,7 @@ ewmh_client_check_hints(client_t *c)
if(reply && (data = xcb_get_property_value(reply))) if(reply && (data = xcb_get_property_value(reply)))
{ {
state = (xcb_atom_t *) data; state = (xcb_atom_t *) data;
for(int i = 0; i < xcb_get_property_value_length(reply); i++) for(int i = 0; i < xcb_get_property_value_length(reply) / ssizeof(xcb_atom_t); i++)
if(state[i] == _NET_WM_WINDOW_TYPE_DESKTOP) if(state[i] == _NET_WM_WINDOW_TYPE_DESKTOP)
c->type = MAX(c->type, WINDOW_TYPE_DESKTOP); c->type = MAX(c->type, WINDOW_TYPE_DESKTOP);
else if(state[i] == _NET_WM_WINDOW_TYPE_DIALOG) else if(state[i] == _NET_WM_WINDOW_TYPE_DIALOG)