forked from enlightenment/efl
XCB used to provide iterators for requests returning
list of values. Recent versions dropped it and return arrays instead. Adapt code to use arrays unconditionally (arrays were present in earlier libxcb versions). Patch by Mikhail Gusarov SVN revision: 49667
This commit is contained in:
parent
4eadc13551
commit
7c4ab89bc9
|
@ -859,11 +859,14 @@ ecore_x_killall(Ecore_X_Window root)
|
|||
reply = xcb_query_tree_reply(_ecore_xcb_conn, cookie, NULL);
|
||||
if (reply)
|
||||
{
|
||||
xcb_window_iterator_t iter;
|
||||
xcb_window_t *wins = NULL;
|
||||
int tree_c_len;
|
||||
int i;
|
||||
|
||||
iter = xcb_query_tree_children_iterator(reply);
|
||||
for (; iter.rem; xcb_window_next(&iter))
|
||||
xcb_kill_client(_ecore_xcb_conn, *iter.data);
|
||||
wins = xcb_query_tree_children(reply);
|
||||
tree_c_len = xcb_query_tree_children_length(reply);
|
||||
for (i = 0; i < tree_c_len; i++)
|
||||
xcb_kill_client(_ecore_xcb_conn, wins[i]);
|
||||
free(reply);
|
||||
}
|
||||
}
|
||||
|
@ -948,12 +951,13 @@ _ecore_xcb_fd_handler_buf(void *data, Ecore_Fd_Handler *fd_handler __UNUSED__)
|
|||
static int
|
||||
_ecore_xcb_key_mask_get(xcb_keysym_t sym)
|
||||
{
|
||||
xcb_keycode_iterator_t iter;
|
||||
xcb_get_modifier_mapping_cookie_t cookie;
|
||||
xcb_get_modifier_mapping_reply_t *reply;
|
||||
xcb_key_symbols_t *symbols;
|
||||
xcb_keysym_t sym2;
|
||||
int i, j;
|
||||
xcb_keycode_t *keycodes = NULL;
|
||||
int mod_keys_len;
|
||||
const int masks[8] =
|
||||
{
|
||||
XCB_MOD_MASK_SHIFT,
|
||||
|
@ -977,13 +981,13 @@ _ecore_xcb_key_mask_get(xcb_keysym_t sym)
|
|||
return 0;
|
||||
}
|
||||
|
||||
iter = xcb_get_modifier_mapping_keycodes_iterator(reply);
|
||||
|
||||
for (i = 0; iter.rem; xcb_keycode_next(&iter), i++)
|
||||
keycodes = xcb_get_modifier_mapping_keycodes(reply);
|
||||
mod_keys_len = xcb_get_modifier_mapping_keycodes_length(reply);
|
||||
for (i = 0; i < mod_keys_len; i++)
|
||||
{
|
||||
for (j = 0; j < 8; j++)
|
||||
{
|
||||
sym2 = xcb_key_symbols_get_keysym(symbols, *iter.data, j);
|
||||
sym2 = xcb_key_symbols_get_keysym(symbols, keycodes[i], j);
|
||||
if (sym2 != 0) break;
|
||||
}
|
||||
if (sym2 == sym)
|
||||
|
|
|
@ -1440,7 +1440,6 @@ _ecore_x_window_at_xy_get(Ecore_X_Window base,
|
|||
Ecore_X_Window *skip,
|
||||
int skip_num)
|
||||
{
|
||||
xcb_window_iterator_t iter_children;
|
||||
xcb_get_window_attributes_cookie_t cookie_get_window_attributes;
|
||||
xcb_get_geometry_cookie_t cookie_get_geometry;
|
||||
xcb_query_tree_cookie_t cookie_query_tree;
|
||||
|
@ -1453,6 +1452,9 @@ _ecore_x_window_at_xy_get(Ecore_X_Window base,
|
|||
int16_t win_y;
|
||||
uint16_t win_width;
|
||||
uint16_t win_height;
|
||||
xcb_window_t *wins = NULL;
|
||||
int tree_c_len;
|
||||
int i;
|
||||
|
||||
cookie_get_window_attributes = xcb_get_window_attributes_unchecked(_ecore_xcb_conn, base);
|
||||
cookie_get_geometry = xcb_get_geometry_unchecked(_ecore_xcb_conn, base);
|
||||
|
@ -1522,18 +1524,19 @@ _ecore_x_window_at_xy_get(Ecore_X_Window base,
|
|||
return base;
|
||||
}
|
||||
|
||||
iter_children = xcb_query_tree_children_iterator(reply_query_tree);
|
||||
for (; iter_children.rem; xcb_window_next(&iter_children))
|
||||
wins = xcb_query_tree_children(reply_query_tree);
|
||||
tree_c_len = xcb_query_tree_children_length(reply_query_tree);
|
||||
for(i = 0; i < tree_c_len; i++)
|
||||
{
|
||||
if (skip)
|
||||
{
|
||||
int j;
|
||||
|
||||
for (j = 0; j < skip_num; j++)
|
||||
if (*iter_children.data == skip[j])
|
||||
if (wins[i] == skip[j])
|
||||
continue;
|
||||
}
|
||||
child = _ecore_x_window_at_xy_get(*iter_children.data, win_x, win_y, x, y, skip, skip_num);
|
||||
child = _ecore_x_window_at_xy_get(wins[i], win_x, win_y, x, y, skip, skip_num);
|
||||
if (child)
|
||||
{
|
||||
free(reply_query_tree);
|
||||
|
|
Loading…
Reference in New Issue