Enlightenment CVS committal Author : ningerso Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_embed.c Log Message: Minor cleanup of mouse dispatching logic. Walking the clippee list while removing clippees is probably safe, but it makes me nervous. So just get the front of the list until it's empty. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_embed.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -3 -r1.53 -r1.54 --- ewl_embed.c 14 Mar 2006 05:24:59 -0000 1.53 +++ ewl_embed.c 31 Mar 2006 06:31:42 -0000 1.54 @@ -656,26 +656,23 @@ if (!widget) widget = EWL_WIDGET(embed); } + else + widget = embed->last.mouse_in; - if (widget) { - /* - * Defocus all widgets up to the level of a shared parent of - * old and newly focused widgets. - */ - while (embed->last.mouse_in && (widget != embed->last.mouse_in) - && !ewl_widget_parent_of(embed->last.mouse_in, widget)) { - ewl_embed_mouse_cursor_set(embed->last.mouse_in); - - ewl_object_state_remove(EWL_OBJECT(embed->last.mouse_in), - EWL_FLAG_STATE_MOUSE_IN); - ewl_callback_call(embed->last.mouse_in, EWL_CALLBACK_MOUSE_OUT); + /* + * Defocus all widgets up to the level of a shared parent of + * old and newly focused widgets. + */ + while (embed->last.mouse_in && (widget != embed->last.mouse_in) + && !ewl_widget_parent_of(embed->last.mouse_in, widget)) { + ewl_embed_mouse_cursor_set(embed->last.mouse_in); + + ewl_object_state_remove(EWL_OBJECT(embed->last.mouse_in), + EWL_FLAG_STATE_MOUSE_IN); + ewl_callback_call(embed->last.mouse_in, EWL_CALLBACK_MOUSE_OUT); - if (embed->last.mouse_in) - embed->last.mouse_in = embed->last.mouse_in->parent; - } + embed->last.mouse_in = embed->last.mouse_in->parent; } - else - widget = embed->last.mouse_in; /* * Pass out the movement event up the chain, allows parents to @@ -1019,7 +1016,7 @@ { const char *type; Ecore_List *obj_list; - Evas_List *clippees, *l; + const Evas_List *clippees; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("e", e); @@ -1034,9 +1031,8 @@ /* we have to unclip all of the clippees so that we don't end up * getting into an infinite loop resetting the clip later */ - clippees = evas_object_clipees_get(obj); - for (l = clippees; l; l = l->next) - evas_object_clip_unset(l->data); + while ((clippees = evas_object_clipees_get(obj))) + evas_object_clip_unset(clippees->data); if (e->obj_cache) { type = evas_object_type_get(obj); ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs