Genlist: Focus does not move, if it is set on item content objects.
authorchinmaya <chinmaya@chinmaya-VirtualBox.(none)>
Mon, 26 May 2014 06:45:54 +0000 (15:45 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Mon, 26 May 2014 06:45:54 +0000 (15:45 +0900)
Summary:
If focus is set on item content object, it's treated as a
         different object which results the focus deadlock. So, every
         time whenever focus sets on item content object, we need to
         unset and set the focus on genlist object. Thanks to Seoz for
         the idea.

Test Plan: elementary_test -to "genlist focus"

Reviewers: seoz, SanghyeonLee, eagleeye

CC: seoz
Differential Revision: https://phab.enlightenment.org/D891

src/lib/elm_genlist.c

index 640b618fddbc087d44bf5bd8b71d3bfbd13c4a3a..67f3749aec01dd061870807d967586ad3401058a 100644 (file)
@@ -5507,6 +5507,21 @@ _item_select(Elm_Gen_Item *it)
         else
           sd->last_selected_item = (Elm_Object_Item *)it;
      }
+
+   if (!(sd->focus_on_selection_enabled || _elm_config->item_select_on_focus_disable))
+     {
+        Evas_Object *swallow_obj;
+        Eina_List *l;
+        EINA_LIST_FOREACH(it->content_objs, l, swallow_obj)
+          {
+             if (elm_object_focus_get(swallow_obj))
+               {
+                  elm_object_focus_set( obj, EINA_FALSE);
+                  elm_object_focus_set( obj, EINA_TRUE);
+                  break;
+               }
+          }
+     }
    evas_object_unref(obj);
 }