davemds pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=d92869633ffeca83acd3f3389368bd60d1e43854

commit d92869633ffeca83acd3f3389368bd60d1e43854
Author: Dave Andreoli <d...@gurumeditation.it>
Date:   Sun Jan 24 16:44:57 2016 +0100

    Genlist: do not select the item two times in case of a double click.
    
    In the case of a genlist set as ELM_OBJECT_SELECT_MODE_ALWAYS the 
"selected" cb was called 2 times. This @fix that by skipping the selection code 
in case the click is not the first one (EVAS_BUTTON_NONE).
    
    Also merge the conditions of two consecutive "if" in a single statement.
---
 src/lib/elm_genlist.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 572e734..2f57dea 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -4881,12 +4881,13 @@ _item_mouse_up_cb(void *data,
           }
      }
 
-   if (_is_no_select(it) ||
+   if ((ev->flags != EVAS_BUTTON_NONE) ||
+       (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) ||
+       !it->base->still_in ||
+       _is_no_select(it) ||
        (eo_do_ret(EO_OBJ(it), tmp, elm_wdg_item_disabled_get())))
      return;
 
-   if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD || !it->base->still_in) 
return;
-
    evas_object_ref(sd->obj);
 
    if (sd->multi &&
@@ -4928,7 +4929,7 @@ _item_mouse_up_cb(void *data,
         if (_item_select(it)) goto deleted;
      }
 
-   if ((ev->flags == EVAS_BUTTON_NONE) && (sd->focused_item != EO_OBJ(it)))
+   if (sd->focused_item != EO_OBJ(it))
      elm_object_item_focus_set(EO_OBJ(it), EINA_TRUE);
 
 deleted:

-- 


Reply via email to