{
struct vigs_capture_work_item *item = (struct vigs_capture_work_item*)wq_item;
struct vigs_onscreen_server *server = item->server;
+ struct vigs_surface *root_sfc = server->base.root_sfc;
+ bool captured = false;
uint32_t width, height;
- bool captured;
void *pixels;
pixels = vigs_server_get_capture_buffer(&server->base, &width, &height);
- captured = server->base.backend->capture(server->base.root_sfc, pixels);
+ if (root_sfc && pixels) {
+ captured = server->base.backend->capture(root_sfc, pixels);
+ }
server->capture_ops->process_captured(captured, pixels, width, height);
g_free(item);