Enlightenment CVS committal Author : ningerso Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_container.c ewl_embed.c Log Message: Faster child widget lookup by moving visible check earlier in process. Repeat lookup after callbacks for mouse down so that setting focused and last clicked widget will reference valid widgets. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_container.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -3 -r1.51 -r1.52 --- ewl_container.c 6 Nov 2006 16:12:20 -0000 1.51 +++ ewl_container.c 15 Dec 2006 06:29:58 -0000 1.52 @@ -701,18 +701,18 @@ * Search through the children to find an intersecting child. */ while ((child = ecore_dlist_next(EWL_CONTAINER(widget)->children))) { - if (x >= (CURRENT_X(child) - INSET_LEFT(child)) + if (VISIBLE(child) && !DISABLED(child) + && x >= (CURRENT_X(child) - INSET_LEFT(child)) && y >= (CURRENT_Y(child) - INSET_TOP(child)) && (CURRENT_X(child) + CURRENT_W(child) + INSET_RIGHT(child)) >= x && (CURRENT_Y(child) + CURRENT_H(child) + INSET_BOTTOM(child)) >= y) { - if (child->toplayered && VISIBLE(child)) { + if (child->toplayered) { found = child; break; } - if ((!found || LAYER(found) <= LAYER(child)) - && VISIBLE(child)) + if ((!found || LAYER(found) <= LAYER(child))) found = child; } } =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_embed.c,v retrieving revision 1.100 retrieving revision 1.101 diff -u -3 -r1.100 -r1.101 --- ewl_embed.c 12 Dec 2006 15:53:35 -0000 1.100 +++ ewl_embed.c 15 Dec 2006 06:29:58 -0000 1.101 @@ -584,6 +584,28 @@ } } + /* + * Refetch the widget at these coords to determine if last.clicked and + * focus needs updating. + */ + widget = ewl_container_child_at_recursive_get(EWL_CONTAINER(embed), x, y); + if (!widget) + widget = EWL_WIDGET(embed); + + /* + * Repeat the lookup process to ensure that the callbacks didn't cause a + * change in the returned widget by destroying or hiding the previous + * result. + */ + temp = widget; + while (temp && temp->parent && ewl_widget_internal_is(temp)) + temp = temp->parent; + + if (temp != embed->last.clicked) { + embed->last.clicked = temp; + ewl_embed_focused_widget_set(embed, temp); + } + DLEAVE_FUNCTION(DLEVEL_STABLE); } ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs