From 1d835f20352d55ae4e4dd2d62992c32e76562aac Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sun, 28 Jun 2020 13:49:44 +0000 Subject: [PATCH] screencopy: Use correct dmabuf to get y-inversion flag Because wlr_renderer_blit_dmabuf() undoes y-inversion on the source buffer, it is incorrect to pass the y-inversion flag of the source buffer to the user. --- types/wlr_screencopy_v1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/wlr_screencopy_v1.c b/types/wlr_screencopy_v1.c index 0a5b2bd2..702a62b5 100644 --- a/types/wlr_screencopy_v1.c +++ b/types/wlr_screencopy_v1.c @@ -208,7 +208,7 @@ static void frame_handle_output_precommit(struct wl_listener *listener, ok = wlr_output_export_dmabuf(frame->output, &attr); ok = ok && wlr_renderer_blit_dmabuf(renderer, &dma_buffer->attributes, &attr); - flags |= attr.flags & WLR_DMABUF_ATTRIBUTES_FLAGS_Y_INVERT ? + flags |= dma_buffer->attributes.flags & WLR_DMABUF_ATTRIBUTES_FLAGS_Y_INVERT ? ZWLR_SCREENCOPY_FRAME_V1_FLAGS_Y_INVERT : 0; wlr_dmabuf_attributes_finish(&attr); }