Check return value if already a listener is registered

This commit is contained in:
Julian Christian Albrecht 2020-04-07 10:28:21 +02:00 committed by akallabeth
parent c6e675bfb7
commit 3029e3b2cf

View File

@ -122,10 +122,13 @@ static UwacReturnCode set_cursor_image(UwacSeat* seat, uint32_t serial)
break;
}
int buffer_add_listener_success = -1;
if (buffer)
wl_buffer_add_listener(buffer, &buffer_release_listener, seat);
{
buffer_add_listener_success = wl_buffer_add_listener(buffer, &buffer_release_listener, seat);
}
if (surface)
if (surface && buffer_add_listener_success > -1)
{
wl_surface_attach(surface, buffer, -x, -y);
wl_surface_damage(surface, 0, 0, image->width, image->height);