aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndri Yngvason <andri@yngvason.is>2020-06-13 13:01:11 +0000
committerSimon Ser <contact@emersion.fr>2020-06-13 15:39:49 +0200
commitcae533cad2b068dd13993a64fdc46c243c4984a2 (patch)
tree63464cee4b1054270696f50e890687f4b593db99
parenta6a5a19356ea0c5ea635a53d6d83b283f5c8a7c8 (diff)
screencopy: Use correct constant for y-inversion
-rw-r--r--types/wlr_screencopy_v1.c8
1 files 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 };