Hello e-developers,
I'm working on the enna project and found a bug within the elementary
library. The error occurs using the generic list when scrolling.
As far as I was able to analyse, the list is organized with blocks of
max 32 items. Now, when selecting an item within a block other than the
first item of that block, the wrong region is scrolled to. Thus the
selected item is not visible.
I've modified the elementary_test a bit to reproduce this by generating
a long list (2000 items), with three jumps (selections) each after 5
seconds. The first one jumps to item 38, so the 6th item of the second
block. This won't work, instead the region of items 43 to 52 is shown.
The second jump is to item 32 which works fine and shows that item on
the top of the visible area. The third jump again to item 38 will work
too as the block seems to be correctly 'initialized' now.
There's also some debugging output showing that the coordinates of the
same item within the list changes (y from 780 to 240).
Interestingly when setting the whole window hight to 800px everything
works fine. But e.g. with 400px it's reproducable.
Attached you'll find the patch for that test. Just start the first
"Genlist" example to reproduce.
I just used the latest revision from repository.
Bill
Index: src/lib/elm_genlist.c
===================================================================
--- src/lib/elm_genlist.c (revision 41218)
+++ src/lib/elm_genlist.c (working copy)
@@ -1898,6 +1898,8 @@
it->wd->show_item->showme = EINA_FALSE;
it->wd->show_item = NULL;
}
+ fprintf(stderr, "##########DEBUG############# y: %i, it->block->y: %i,
it->h: %i, it->block->h: %i\n", it->y, it->block->y, it->h, it->block->h);
+ elm_genlist_item_update(it);
elm_smart_scroller_child_region_show(it->wd->scr,
it->x + it->block->x,
it->y + it->block->y,
Index: src/bin/test.c
===================================================================
--- src/bin/test.c (revision 41218)
+++ src/bin/test.c (working copy)
@@ -2159,11 +2159,20 @@
printf("sel item data [%p] on genlist obj [%p], item pointer [%p]\n", data,
obj, event_info);
}
+static int _test_timer_cb(void *data)
+{
+ Elm_Genlist_Item* it = (Elm_Genlist_Item*)data;
+ elm_genlist_item_show(it);
+ elm_genlist_item_selected_set(it, 1);
+ return 0;
+}
+
static void
my_bt_29(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *win, *bg, *gl;
Elm_Genlist_Item *gli;
+ Elm_Genlist_Item *testitem1, *testitem2, *testitem3;
int i;
win = elm_win_add(NULL, "genlist", ELM_WIN_BASIC);
@@ -2195,9 +2204,18 @@
ELM_GENLIST_ITEM_NONE,
gl_sel/* func */,
(void *)(i * 10)/* func data */);
+ if (i==38) testitem1=gli;
+ if (i==32) testitem2=gli;
+ if (i==38) testitem3=gli;
}
- evas_object_resize(win, 480, 800);
+// with a window size of 800, it works fine
+// evas_object_resize(win, 480, 800);
+ evas_object_resize(win, 480, 400);
evas_object_show(win);
+
+ ecore_timer_add(5, _test_timer_cb, testitem1);
+ ecore_timer_add(10, _test_timer_cb, testitem2);
+ ecore_timer_add(15, _test_timer_cb, testitem3);
}
static void
------------------------------------------------------------------------------
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel