forked from enlightenment/enlightenment
gadget recalc - if you add a job...del and add again
if you add a job to do things like defer a calc till later in the loop (or if later in size calc - it'd be the next loop run after rendering) ... then del the previous job and add a new one. why? order of operation. if you add job a... because of event a, then add job b, because of event b ... if for whatever reason, event a happens again and you skip adding job a... job a will run before jbo b, even though the LAST event is later and that 2nd event a may relay on event b state/calculations. so always del then add to ensure then that job a happens ater b if this scenario happens. it just leads to fewer surprises and weird issues.
This commit is contained in:
parent
cc9c0f85c6
commit
3051df7fee
|
@ -140,7 +140,7 @@ _site_recalc_job_cb(E_Gadget_Site *zgs)
|
||||||
static void
|
static void
|
||||||
_site_recalc_job(E_Gadget_Site *zgs)
|
_site_recalc_job(E_Gadget_Site *zgs)
|
||||||
{
|
{
|
||||||
if (zgs->calc_job) return;
|
if (zgs->calc_job) ecore_job_del(zgs->calc_job);
|
||||||
zgs->calc_job = ecore_job_add((Ecore_Cb)_site_recalc_job_cb, zgs);
|
zgs->calc_job = ecore_job_add((Ecore_Cb)_site_recalc_job_cb, zgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue