Skip to content
Commit 3b3e81f4 authored by Pekka Paalanen's avatar Pekka Paalanen Committed by Kristian Høgsberg
Browse files

cursor: handle running out of buffer space



If posix_fallocate is available, use it to detect when we are running
out of buffer space.

Propagate the failure properly through the various functions, stopping
loading cursors but keeping the cursors that were already successfully
loaded.

This may result in an animated cursor not having all of its images, or a
cursor theme not having all of its cursors. When that happens, the
failure is NOT communicated to the application. Instead, the application
will get NULL from wl_cursor_theme_get_cursor() for a cursor that was
not loaded successfully. If an animated cursor is missing only some
images, the animation is truncated but the cursor is still available.

This patch relies on the commit "os: use posix_fallocate in creating
sharable buffers" for defining HAVE_POSIX_FALLOCATE.

Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
parent 011b6954
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment