Page MenuHomePhabricator

efl_ui_widget: add a place to share data

Authored by bu5hm4n on Aug 20 2019, 12:53 AM.



this introduces a shared place to all widgets. The shared pointer is
allocated in the window, as the window outlifes every widget that is
part of it.

This struct will be later used for further optimizations like:

  1. There are really heavy focus operations which are only needed for

gengrid/genlst, there is no point in executing them if there is no
gen**** added to the window object. So we can skip the custom
parent_provider logic that is only introduced for gengrid / genlist.

  1. Legacy focus APIs must do list walks, which means, on every focus

operation we always have to walk the full list up to the parent, which
is annoying and slow, as we *most of the time* do not use legacy focus

This list can be continued, the above two cases are fixed in the next

Diff Detail

rEFL core/efl
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
bu5hm4n created this revision.Aug 20 2019, 12:53 AM
bu5hm4n requested review of this revision.Aug 20 2019, 12:53 AM
cedric accepted this revision.Aug 20 2019, 11:47 AM
This revision is now accepted and ready to land.Aug 20 2019, 11:47 AM
Closed by commit rEFLaa2d94f901f4: efl_ui_widget: add a place to share data (authored by Marcel Hollerbach <>, committed by cedric). · Explain WhyAug 20 2019, 12:32 PM
This revision was automatically updated to reflect the committed changes.


@YOhoho and I found an issue related to this patch.

Based on @YOhoho 's investigation, moving obj = efl_constructor(efl_super(obj, MY_CLASS)); below efl_ui_widget_sub_object_add(parent, obj); causes _on_sub_object_size_hint_change callback cannot be called correctly.
Because event callbacks can be successfully registered after evas_object_callback_init() is called in efl_canvas_object's constructor.
Since _on_sub_object_size_hint_change callback is registered in efl_ui_widget_sub_object_add() which is called prior to efl_constructor of efl_canvas_object now, _on_sub_object_size_hint_change callback is not called correctly.

It is found that moving codes lines 4791~4795 to the line 4772 fixes the issue but we are not sure if this is the correct fix based on your patches (We are not sure if moving codes may make D9642~D9646 also work correctly)

So could you please check how to fix the _on_sub_object_size_hint_change issue with working your patches as well? :)

I attach the test code to reproduce the _on_sub_object_size_hint_change issue.

bu5hm4n added a subscriber: Hermet.Sep 4 2019, 3:07 AM

Ooooookay, that is like the weirdest issue i have ever seen.

It seems evas adds a event callback to get notifier when a new callback is added, i think this is kind of a bad idea, as this will cause a lot of event emissions and walking, and it seems that is causing the problem here, What do you think of migrating this evas code from callbacks to a actual overwriting the callback_add ? (I think we should ask more canvas people for that, @Hermet @zmike)

Otherwise i could create a quick fix for it?

Honestly, I dont have enough knowledge about canvas object's event so I cannot judge your idea.. :(
As you said we should ask canvas people about it.

Anyway, based on our release schedule, I think Quick patch + New task to discuss the above would be nice.

Could you make a quick patch to solve the issue with your patches working correctly? :)

It would be nice if you raise a new task to discuss your idea about current event logics!