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.
This commit is contained in:
Simon Ser 2023-06-23 20:03:58 +02:00 committed by Alexander Orzechowski
parent bb91787b5f
commit 71c87ff4b8
2 changed files with 64 additions and 2 deletions

View file

@ -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.
*/