From cae533cad2b068dd13993a64fdc46c243c4984a2 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sat, 13 Jun 2020 13:01:11 +0000 Subject: [PATCH] screencopy: Use correct constant for y-inversion --- types/wlr_screencopy_v1.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/types/wlr_screencopy_v1.c b/types/wlr_screencopy_v1.c index bc8f4a28..0a5b2bd2 100644 --- a/types/wlr_screencopy_v1.c +++ b/types/wlr_screencopy_v1.c @@ -197,9 +197,11 @@ static void frame_handle_output_precommit(struct wl_listener *listener, wl_shm_buffer_begin_access(shm_buffer); void *data = wl_shm_buffer_get_data(shm_buffer); - flags = 0; - ok = wlr_renderer_read_pixels(renderer, fmt, &flags, stride, - width, height, x, y, 0, 0, data); + uint32_t renderer_flags = 0; + ok = wlr_renderer_read_pixels(renderer, fmt, &renderer_flags, + stride, width, height, x, y, 0, 0, data); + flags |= renderer_flags & WLR_RENDERER_READ_PIXELS_Y_INVERT ? + ZWLR_SCREENCOPY_FRAME_V1_FLAGS_Y_INVERT : 0; wl_shm_buffer_end_access(shm_buffer); } else if (dma_buffer) { struct wlr_dmabuf_attributes attr = { 0 };