From 5ba32686943f839d072426d9ffd172decaee0e3e Mon Sep 17 00:00:00 2001 From: vaxerski Date: Mon, 7 Aug 2023 18:58:44 +0200 Subject: [PATCH] internal: use newBuf data for storage of the bitmap --- src/events/Events.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/events/Events.cpp b/src/events/Events.cpp index 3e81901..ccf333e 100644 --- a/src/events/Events.cpp +++ b/src/events/Events.cpp @@ -324,7 +324,7 @@ void Events::handleSCReady(void* lsdata, struct zwlr_screencopy_frame_v1* frame, cairo_surface_flush(oldSurface); - newBuf.surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, transformedSize.x, transformedSize.y); + newBuf.surface = cairo_image_surface_create_for_data((unsigned char*)newBuf.data, CAIRO_FORMAT_ARGB32, transformedSize.x, transformedSize.y, transformedSize.x * 4); const auto PCAIRO = cairo_create(newBuf.surface);