From 71c87ff4b8b6a4bf080273255a25685270389fd6 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 23 Jun 2023 20:03:58 +0200 Subject: cursor: add wlr_cursor_set_buffer() A saner replacement for wlr_cursor_set_image(): - Takes a wlr_buffer instead of numerous parameters and a hardcoded format. - The scale is not used to filter outputs. - A ref to the buffer is kept to apply it to new outputs. --- include/wlr/types/wlr_cursor.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/wlr/types/wlr_cursor.h b/include/wlr/types/wlr_cursor.h index a4c2e731..96059255 100644 --- a/include/wlr/types/wlr_cursor.h +++ b/include/wlr/types/wlr_cursor.h @@ -147,6 +147,15 @@ void wlr_cursor_set_image(struct wlr_cursor *cur, const uint8_t *pixels, int32_t stride, uint32_t width, uint32_t height, int32_t hotspot_x, int32_t hotspot_y, float scale); +/** + * Set the cursor buffer. + * + * The buffer is used on all outputs and is scaled accordingly. The hotspot is + * expressed in logical coordinates. A NULL buffer hides the cursor. + */ +void wlr_cursor_set_buffer(struct wlr_cursor *cur, struct wlr_buffer *buffer, + int32_t hotspot_x, int32_t hotspot_y, float scale); + /** * Hide the cursor image. */ -- cgit v1.2.3