Destroying released cursor buffers.
This commit is contained in:
parent
db3bcffd03
commit
ce2f2012ae
@ -79,6 +79,15 @@ error_mmap:
|
|||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void on_buffer_release(void *data, struct wl_buffer *wl_buffer) {
|
||||||
|
(void)data;
|
||||||
|
wl_buffer_destroy(wl_buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
const struct wl_buffer_listener buffer_release_listener = {
|
||||||
|
on_buffer_release
|
||||||
|
};
|
||||||
|
|
||||||
static UwacReturnCode
|
static UwacReturnCode
|
||||||
set_cursor_image(UwacSeat* seat, uint32_t serial)
|
set_cursor_image(UwacSeat* seat, uint32_t serial)
|
||||||
{
|
{
|
||||||
@ -119,6 +128,9 @@ set_cursor_image(UwacSeat* seat, uint32_t serial)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (buffer)
|
||||||
|
wl_buffer_add_listener(buffer, &buffer_release_listener, seat);
|
||||||
|
|
||||||
if (surface) {
|
if (surface) {
|
||||||
wl_surface_attach(surface, buffer, -x, -y);
|
wl_surface_attach(surface, buffer, -x, -y);
|
||||||
wl_surface_damage(surface, 0, 0,
|
wl_surface_damage(surface, 0, 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user