Page MenuHomePhabricator

efl_ui_widget: fix tree_unfocusable setting
ClosedPublic

Authored by bu5hm4n on Mar 23 2020, 3:00 AM.

Details

Summary

when setting twice the same value, unsetting the same value would not
restore the same state in the tree again. With this commit, we ensure
this is working correctly.

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bu5hm4n created this revision.Mar 23 2020, 3:00 AM

It seems that this patch has no reviewers specified. If you are unsure who can review your patch, please check this wiki page and see if anyone can be added: https://phab.enlightenment.org/w/maintainers_reviewers/

bu5hm4n requested review of this revision.Mar 23 2020, 3:00 AM
zmike requested changes to this revision.Mar 23 2020, 6:55 AM
zmike added a subscriber: zmike.
zmike added inline comments.
src/tests/elementary/efl_ui_test_widget.c
363

Shouldn't this still be 1 since you've just set it twice above?

This revision now requires changes to proceed.Mar 23 2020, 6:55 AM
bu5hm4n requested review of this revision.Mar 23 2020, 6:57 AM
bu5hm4n added inline comments.
src/tests/elementary/efl_ui_test_widget.c
363

No, it must be 0 setting a widget twice disalbed or tree_unfocusable is equal to calling it once. The second call is basically a NOP

zmike added a comment.Mar 23 2020, 7:03 AM

That was previously my understanding as well, but the implementation here appears to use a counter

The counter does not matter here, we only allow a difference of distance between a child and a parent of 1. The counter here is used to keep track of if a object is made tree_unfocusable by calling the API on the object itself, or on a parent. This replaced the old implementation, because the getter of that property was querying the while parent chain in order to get the correct value, now its a simple compare of an int. Which safes time.

zmike added a comment.Mar 23 2020, 7:14 AM

Can you add another patch to add comments about this to both function implementations to avoid future confusion?

zmike accepted this revision.Mar 23 2020, 9:10 AM
This revision is now accepted and ready to land.Mar 23 2020, 9:10 AM
Closed by commit rEFL8e0a7cedc1b8: efl_ui_widget: fix tree_unfocusable setting (authored by Marcel Hollerbach <mail@marcel-hollerbach.de>, committed by zmike). · Explain WhyMar 23 2020, 9:12 AM
This revision was automatically updated to reflect the committed changes.