Page MenuHomePhabricator

elm_widget: fix correct parent when widget parent changed
Changes PlannedPublic

Authored by YOhoho on Mar 7 2019, 2:35 AM.

Details

Summary

After widget parent is changed, sub object is invalidated while 'previous'
parent is invalidating, because efl_parent is not changed even if
_elm_widget_sub_object_redirect_to_top is called.
This fixes that issue.

Test Plan
  1. check elm_box test (make check)
    1. elementary_test -to 'efl.ui.box'
    2. Click Flow checkbox.
    3. Resize window.
    4. Check it works.

Diff Detail

Repository
rEFL core/efl
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10029
Build 8116: arc lint + arc unit
YOhoho created this revision.Mar 7 2019, 2:35 AM
YOhoho requested review of this revision.Mar 7 2019, 2:35 AM

This fixed my segfaults and reboots when pressing the Flow checkbox in elementary_test Efl.Ui.Box.

bu5hm4n requested changes to this revision.Mar 7 2019, 4:05 AM
bu5hm4n added a subscriber: bu5hm4n.

Mhm, the so parent should never change, its basically settled and used by the user, I am not sure if we should manipulate this here. EFL_parent is never adjusted in elm APIs at all ...

This revision now requires changes to proceed.Mar 7 2019, 4:05 AM
YOhoho added a comment.Mar 7 2019, 8:11 AM

Mhm, the so parent should never change, its basically settled and used by the user, I am not sure if we should manipulate this here. EFL_parent is never adjusted in elm APIs at all ...

I don't understand what do you request.

elm_layout APIs adjust EFL_parent.

What i mean is: Not every widget redirects a widget to the top widget when its unpacked, which means, only box (and a handfull of others) will do that. Which is kind of weird and unexpected to the user. (As an example: gengrid does not do this, efl_ui_table does not do this)

So for me there are two possible solutions here:

  • Accept that a widget needs to be recreated when the widget-parent dies.
  • Redirect every sobj in elm_widget_sub_object_del to the top level widget, so we have a consistency over *every* widget, and not just box.

What i mean is: Not every widget redirects a widget to the top widget when its unpacked, which means, only box (and a handfull of others) will do that. Which is kind of weird and unexpected to the user. (As an example: gengrid does not do this, efl_ui_table does not do this)

So for me there are two possible solutions here:

  • Accept that a widget needs to be recreated when the widget-parent dies.
  • Redirect every sobj in elm_widget_sub_object_del to the top level widget, so we have a consistency over *every* widget, and not just box.

Thank you to point out that.
I took a look _elm_widget_sub_object_redirect_to_top history(D3957). so, all widget need to call redirect function instead of sub_object_del during unpack/unset.
This changing make sense with the patches(D8237, D8238)?

Hermet added a comment.Mar 7 2019, 8:26 PM

Originally, the unpack/unset objects have been just left as the dangling objects though the behavior is not correct.
We should make the behavior policy for those dangling objs to connect to a new parents and IMO, the most top object(window) is the right one .

However, we can make it change only for the new interfaces but not legacy.
I guess if we change the behavior, probably compatibility issues come a lot.

YOhoho planned changes to this revision.Mar 8 2019, 1:37 AM

This means we could just reparent the widget to the top element in sub_object_del instead of NULL'ing the parent out, when we are not inheriting from efl_ui_legacy ?