summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-12-10 10:54:32 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-12-10 10:54:32 +0000
commitf6c99bd806f1a10dd37bad95355e62cebc1a0f2d (patch)
treee46f2cc888bc865a11faabf7edd7fb1d2cfc3ada
parent61a462c04d47f8cc2b7e9b07a704f1c98874dc90 (diff)
downloadefl-f6c99bd806f1a10dd37bad95355e62cebc1a0f2d.tar.gz
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
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
index e9569f650d..5f354a1bd8 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c
@@ -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); */