diff --git a/src/compositor.c b/src/compositor.c index 00b8f3e2..a65dd84a 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -1142,8 +1142,7 @@ weston_output_finish_frame(struct weston_output *output, int msecs) wl_display_get_event_loop(compositor->wl_display); int fd; - wl_signal_emit(&output->frame_signal, &msecs); - + output->frame_time = msecs; if (output->repaint_needed) { weston_output_repaint(output, msecs); return; @@ -2871,6 +2870,8 @@ weston_output_do_read_pixels(struct weston_output *output) { struct weston_read_pixels *r, *next; + wl_signal_emit(&output->frame_signal, &output->frame_time); + glPixelStorei(GL_PACK_ALIGNMENT, 1); wl_list_for_each_safe(r, next, &output->read_pixels_list, link) { glReadPixels(r->x, r->y, r->width, r->height, diff --git a/src/compositor.h b/src/compositor.h index 22e5eb83..9131e46a 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -172,6 +172,7 @@ struct weston_output { int dirty; struct wl_list read_pixels_list; struct wl_signal frame_signal; + uint32_t frame_time; char *make, *model; uint32_t subpixel; diff --git a/src/screenshooter.c b/src/screenshooter.c index ecb8db0a..765369cb 100644 --- a/src/screenshooter.c +++ b/src/screenshooter.c @@ -275,11 +275,6 @@ weston_recorder_frame_notify(struct wl_listener *listener, void *data) r = pixman_region32_rectangles(&damage, &n); if (n == 0) return; - if (recorder->count++ == 0) - /* The first callback gives us the frame immediately - * before the weston_output_damage() call, and - * typically doesn't give us a full frame of damage.*/ - return; header.msecs = msecs; header.nrects = n;