Page MenuHomePhabricator

widget constructor thingy
Closed, ResolvedPublic

Description

@bu5hm4n

Hello~
@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.

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?