ecore evas - wl - detect timestamsp too far in the past and complain

this has all sorts of nasty side effects by rewinding time far too
much and thus causing timers to expire early and so on - these
timestamps are MEANT to be like a frame vsync time... they thus should
be like normally 0.02sec or so in the past or less... (0.008s on
average) so at 0.1 sec complain and ignore the old timestamp. weston
does this and sends us timestmaps 0.33sec in the past ... and its not
nice.

@fix
This commit is contained in:
Carsten Haitzler 2021-12-10 10:54:32 +00:00
parent 61a462c04d
commit f6c99bd806
1 changed files with 8 additions and 0 deletions

View File

@ -42,12 +42,20 @@ _anim_cb_tick(Ecore_Wl2_Window *win EINA_UNUSED, uint32_t timestamp, void *data)
Ecore_Evas *ee = data;
Ecore_Evas_Engine_Wl_Data *edata;
double t;//, rt;
double tnow = ecore_time_get();
/* static double pt = 0.0, prt = 0.0; */
edata = ee->engine.data;
if (!edata->ticking) return;
t = ((double)timestamp / 1000.0);
if ((t - tnow) < -0.1)
{
fprintf(stderr,
"ecore_evas: _anim_cb_tick() -> tick too far in past - %1.5f sec behind\n",
tnow - t);
t = tnow;
}
ecore_loop_time_set(t);
/* rt = ecore_time_get(); */
/* printf("ECORE_EVAS: wl client anim tick %p | %p - %1.5f @ %1.5f delt=%1.5f | %1.5f\n", ee, edata, t, ecore_time_get(), t - pt, rt - prt); */