Revert "elm/genlist: don't process entire item queue on each item add"
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Fri, 1 Nov 2019 10:12:30 +0000 (10:12 +0000)
committerWonki Kim <wonki_.kim@samsung.com>
Mon, 11 Nov 2019 02:20:41 +0000 (11:20 +0900)
commitd18e6fde1943d1cba6cebac4d46931c8a8bdde50
treecea28f4f681f96ce133d545a2a38d5ae185d0503
parentab9d2a8dc87cffc7f996a8d095b4efb3f2dd25c8
Revert "elm/genlist: don't process entire item queue on each item add"

First - the big problem. This breaks enlightenment's bluez5 popup. it
does a sortyed inert using the item data and the item data for one of
the itmes to compare in _cb_insert_cmp() in e_mod_popup.c when it
calls elm_object_item_data_get(0 returns a junk ptr for the item data
after this patch. i haven't managed to figure out exactly why in my
last 30 mins of looking.

But a closer look... this disables immediate processing of:

1. the first block of items (32items) which was intended so for
short/small lists you have some content by the time you go to the
first frame, and at least the first block of itso you seem to have
visual contnt and not a blank list until idlers can process further
content. so the patch being reverted would have gotten rid of this
logic that gets you content as opposed to blank:

  while ((sd->queue) && ((!sd->blocks) || (!sd->blocks->next)))

2. if it's a homogenous list, all items have the same size so we do
have to realize the first item of each class type but ONLY that one.
further items should not need realizing as we can ASSUME the height to
be the same as the first item... that's the point of homogenous +
compress lists - all items of the same class have the same height and
width thus shortcutting further need to calculate nd realize. if we
are reizing everything in a homogenous list then the issue lies with
something going wrong with this above logic. we shokuld be able to
handle such lists super fastif this logic was working.
that's the 2nd while:

   while ((sd->queue) && (sd->blocks) &&
             (sd->homogeneous) && (sd->mode == ELM_LIST_COMPRESS))

so overall, this should not have been realizing every item. either
just the first block of 32, OR just the first item of any class and
thus assume all further items are the same size without realizing
being needed. if these broke then the solution is not commenting this
out but finding out why this logic is breaking :)

and not to mention... this commenting out also caused segfaults in
existing applications which are doing the right thing. perhaps the
sorting logic also needed updating as well if this above is commented out...
but i didn't have time to chase it more than this.

---

This reverts commit 0777b74f07857c86408bc0929e3391ced0e098e4.
src/lib/elementary/elm_genlist.c