From c87c849ec6a166ea7472c5c87d02646dfc7151b4 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 8 Jun 2021 09:15:55 +0200 Subject: backend/x11: use wlr_renderer_begin_with_buffer for cursor --- backend/x11/output.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/x11/output.c b/backend/x11/output.c index 835df3b7..440e26de 100644 --- a/backend/x11/output.c +++ b/backend/x11/output.c @@ -16,11 +16,11 @@ #include #include #include +#include #include #include #include "backend/x11.h" -#include "render/wlr_renderer.h" #include "types/wlr_buffer.h" #include "util/signal.h" #include "util/time.h" @@ -390,12 +390,13 @@ static bool output_cursor_to_picture(struct wlr_x11_output *output, int depth = 32; int stride = buffer->width * 4; - if (!wlr_renderer_bind_buffer(renderer, buffer)) { + uint8_t *data = malloc(buffer->height * stride); + if (data == NULL) { return false; } - uint8_t *data = malloc(buffer->height * stride); - if (data == NULL) { + if (!wlr_renderer_begin_with_buffer(renderer, buffer)) { + free(data); return false; } @@ -404,7 +405,7 @@ static bool output_cursor_to_picture(struct wlr_x11_output *output, stride, buffer->width, buffer->height, 0, 0, 0, 0, data); - wlr_renderer_bind_buffer(renderer, NULL); + wlr_renderer_end(renderer); if (!result) { free(data); -- cgit v1.2.3