return no binding found when trying to incrementally resolve end-of-list mousebinds

in the case where every binding until the end of the binding list has been rejected,
returning NULL must happen in order to inform callers that there is no more resolving
to be done, breaking out of an otherwise infinite resolve loop

ref fe5d2e6e61
This commit is contained in:
Mike Blumenkrantz 2016-02-17 12:33:53 -05:00
parent c14adb768f
commit 3f82a7f1fb
1 changed files with 18 additions and 2 deletions

View File

@ -428,7 +428,15 @@ e_bindings_mouse_button_find(E_Binding_Context ctxt, E_Binding_Event_Mouse_Butto
if (bind_ret && *bind_ret)
start = eina_list_data_find_list(mouse_bindings, *bind_ret);
if (start) start = start->next;
if (start)
{
start = start->next;
if (!start)
{
*bind_ret = NULL;
return NULL;
}
}
EINA_LIST_FOREACH(start ?: mouse_bindings, l, binding)
{
if ((binding->button == (int)ev->button) &&
@ -1187,7 +1195,15 @@ e_bindings_wheel_find(E_Binding_Context ctxt, E_Binding_Event_Wheel *ev, E_Bindi
if (bind_ret && *bind_ret)
start = eina_list_data_find_list(wheel_bindings, *bind_ret);
if (start) start = start->next;
if (start)
{
start = start->next;
if (!start)
{
*bind_ret = NULL;
return NULL;
}
}
EINA_LIST_FOREACH(start ?: wheel_bindings, l, binding)
{
if ((binding->direction == ev->direction) &&