Page MenuHomePhabricator

scroller goes to wrong page once it is resized
Open, NormalPublic


When user call scrollable api within the scroller callback callstack,
some api doesn't work properly because internal value of the scroller is not stable at that time.

In attached project, button makes window resized.
page_show() api will be called inside the resize callback.
requested page number was calculated on the scroll callback previously.
however, the page number is wrong because current_page_get doesn't return proper value inside scroll_cb.

I'm writing this task to get your excellent opinion,
because this problem looks like structural problem (lack of reference transparency)

If someone give me some advice, I do want to improve it.

[Test routine]

  1. build/run attached project.
  2. go to the bottom.
  3. click button 3 times.

akanad created this task.Feb 6 2017, 4:19 AM
akanad added a comment.Feb 9 2017, 4:50 AM

User callback is invoked synchronously inside platform code, like cb_func.page_change(sid->obj, NULL) on the page_show api.
and I guess that it could make recursive unwanted unknown behaviors. doesn't it?

I simulates what I said, in attached sample.
scroller resize callback calls page_show api and page_show api invokes "page,scroll,changed" callback.
and then scroll_cb get wrong result of current_page_get api, because current_page_get api is on the middle of the evas size calculation sequence.

IMHO, user callback should be invoked after logics of scroller(interface_scrollable) by using ecore_job for example.
and it makes EFL logics more simple and pure.

please let me know your opinions.

akanad added a comment.EditedFeb 9 2017, 7:46 PM

I found some invalid point on attached sample code, I will upload new one soon.

stefan_schmidt triaged this task as Normal priority.Feb 10 2017, 6:52 AM
jpeg added a comment.Feb 14 2017, 8:11 PM

Maybe the scroller widget can handle this properly? There's got to be a way... :)

Sure, I can move those code into the scroller.
however I'm not sure whether there are no expected unsafe situations to use async function call by using ecore_job,

jpeg assigned this task to akanad.Feb 21 2017, 1:20 AM
zmike edited projects, added Restricted Project; removed efl.Jun 11 2018, 6:54 AM
zmike edited projects, added efl: widgets; removed Restricted Project.Jun 11 2018, 8:16 AM