It used to be the case (as of 2013 when I originally wrote some code using it) that doing something like
evas_object_smart_need_recalculate_set(obj, 1);
evas_object_smart_calculate(obj);
on any elm widget would force a smart calc. This mechanic is still used internally in elementary and probably in some applications. It seems, however, that this no longer works on any elm widgets which do not implement their own smart calculate function, eg. elm_table. Attempting to do so for one of these widgets ends up calling in to the no-op _elm_widget_evas_object_smart_calculate() function and then returning without doing anything further.
Description
Details
Related Objects
Hi Mike,
Are you sure about the 2013 year? What we did in 2013-2014 was to integrate the Eo files, without changing logic. In 2012, we had to integrate Eo inside EFL and that may have created issues.
I checked the code in Jan 2013 and by reading the code, table and widget seem to behave exactly as now, i.e widget implement a dumb function and table doesn't implement at all.
Are you sure it was working in this way before?
JackDanielZ
I just checked, it has nothing to do with Jack (DAMN!).
It seems to be a part of @glima's changes (happened at roughly the same time). Relevant commit (and probably before):
rELMcec9d3e3bb6afc43dd1c29a936023f3898a4c435
Author: Gustavo Lima Chaves <glima@profusion.mobi>
Date: Thu May 3 22:41:04 2012 +0000
I've just realized that my timeline was irrelevant since the code originally did not use elementary; whether the elementary-powered version has ever worked correctly is questionable.
Will it be necessary for all widgets to implement their own smart calc function or is there an easier way?
Honestly, I don't know. I don't remember the fine details of smart objects. Could you maybe try to add a super call in the empty noop function to see if it fixes your stuff.
What are you trying to achieve that doesn't work? (by smart calculating)
I'm expecting that, for table, the inner evas table will smart calc.
I think potentially calling smart calc on the widget's resize object might be enough for a generic callback?
No idea what a super call is but I enjoy super calling smart calculate on things.
Super call is eo_do_super, that is call the parent implementation. In this case, that would be the equivalent of not blocking the call so it doesn't propagate to the generic small callback.
You suggestion about the widget's resize object: maybe that could work, not sure about the implications. All of those seem reasonable.
I tried super calling, but it didn't seem to work. Manually calling smart calc on the resize object does work and resolve my issue (at least for elm_table), though I am also unsure of possible side effects.
I think you may just have to fix issues as they come, that is, implement the correct function for table, and when needed in other widgets do it there.
I don't know if "resize object" is correct, I think it's just lucky in the case, but yeah, widgets need to pass it to their child widgets (how many there may be).
Hm okay. I guess this ticket should remain open until the rest of the widgets get fixed so that it can be a known issue.
We could just do smart_calculate for resize obj in Elm_Widget.calculate() instead for all widgets?
But in some widget, resize object is not the theme object (e.g. elm notify, popup etcs)