cursor-shape: improve xcursor fallback support, and prefer CSS names

Before this patch, we used legacy X11 xcursor names, and didn't really
have any fallback handling in place (we only tried to fallback to
"xterm", regardless of which cursor shape we were trying to load).

This patch changes two things:

1. Improved fallback support. cursor_shape_to_string() now returns a
   list of strings. This allows us to have per-shape fallbacks, and any
   number of fallbacks.

2. We prefer CSS xcursor names over legacy X11 names.
This commit is contained in:
Daniel Eklöf 2024-02-29 07:54:27 +01:00
parent 6fd533ce13
commit d3b348a5b1
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 53 additions and 46 deletions

View file

@ -9,7 +9,6 @@ enum cursor_shape {
CURSOR_SHAPE_LEFT_PTR,
CURSOR_SHAPE_TEXT,
CURSOR_SHAPE_TEXT_FALLBACK,
CURSOR_SHAPE_TOP_LEFT_CORNER,
CURSOR_SHAPE_TOP_RIGHT_CORNER,
CURSOR_SHAPE_BOTTOM_LEFT_CORNER,
@ -22,7 +21,7 @@ enum cursor_shape {
CURSOR_SHAPE_COUNT,
};
const char *cursor_shape_to_string(enum cursor_shape shape);
const char *const *cursor_shape_to_string(enum cursor_shape shape);
enum wp_cursor_shape_device_v1_shape cursor_shape_to_server_shape(
enum cursor_shape shape);