diff --git a/wayland.c b/wayland.c index f258618..e4a554c 100644 --- a/wayland.c +++ b/wayland.c @@ -157,10 +157,16 @@ void egl_init_surface(struct client_state *state, struct surface *surface) { static const struct wl_callback_listener wl_surface_frame_listener; +bool first_frame_done = false; +uint32_t time_start; static void wl_surface_frame_done(void *data, struct wl_callback *cb, uint32_t time) { + if (!first_frame_done) { + first_frame_done = true; + time_start = time; + } struct surface *surface = data; - surface->time = time; + surface->time = time - time_start; /* Destroy this callback */ wl_callback_destroy(cb);