Enlightenment CVS committal

Author  : moom16
Project : e17
Module  : proto

Dir     : e17/proto/etk/src/lib


Modified Files:
        etk_toplevel_widget.c 


Log Message:
* Fix the focus code


===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_toplevel_widget.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- etk_toplevel_widget.c       29 Oct 2005 19:57:21 -0000      1.5
+++ etk_toplevel_widget.c       29 Oct 2005 23:34:52 -0000      1.6
@@ -326,12 +326,17 @@
    if (node->focusable)
       return node;
    if (!ETK_IS_CONTAINER(node) || !(children = 
etk_container_children_get(ETK_CONTAINER(node))))
-      return NULL;
-
-   if (from && (l = evas_list_find_list(children, from)) && l->next)
-      return _etk_toplevel_widget_next_to_focus_get(ETK_WIDGET(l->next->data), 
NULL);
-   else
       return _etk_toplevel_widget_next_to_focus_get(ETK_WIDGET(node->parent), 
node);
+
+   if (from && (l = evas_list_find_list(children, from)))
+   {
+      if (l->next)
+         return 
_etk_toplevel_widget_next_to_focus_get(ETK_WIDGET(l->next->data), NULL);
+      else
+         return 
_etk_toplevel_widget_next_to_focus_get(ETK_WIDGET(node->parent), node);
+   }
+   else 
+      return 
_etk_toplevel_widget_next_to_focus_get(ETK_WIDGET(children->data), NULL);
 }
 
 /* Gets recursively the previous widget to focus */
@@ -344,12 +349,17 @@
    if (node->focusable)
       return node;
    if (!ETK_IS_CONTAINER(node) || !(children = 
etk_container_children_get(ETK_CONTAINER(node))))
-      return NULL;
-
-   if (from && (l = evas_list_find_list(children, from)) && l->prev)
-      return _etk_toplevel_widget_prev_to_focus_get(ETK_WIDGET(l->prev->data), 
NULL);
-   else
       return _etk_toplevel_widget_prev_to_focus_get(ETK_WIDGET(node->parent), 
node);
+
+   if (from && (l = evas_list_find_list(children, from)))
+   {
+      if (l->prev)
+         return 
_etk_toplevel_widget_prev_to_focus_get(ETK_WIDGET(l->prev->data), NULL);
+      else
+         return 
_etk_toplevel_widget_prev_to_focus_get(ETK_WIDGET(node->parent), node);
+   }
+   else 
+      return 
_etk_toplevel_widget_prev_to_focus_get(ETK_WIDGET(evas_list_data(evas_list_last(children))),
 NULL);
 }
 
 /** @} */




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to