From e4f9dc7d581cf134e850bd02a9c4ae3e5989905a Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 1 Jan 2022 13:56:15 +0100 Subject: render: add render_xcursor_is_valid() Returns true if the provided cursor name is non-NULL, and exist in the currently loaded xcursor theme. --- render.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'render.c') diff --git a/render.c b/render.c index 7e8183df..65c39bf8 100644 --- a/render.c +++ b/render.c @@ -3801,6 +3801,14 @@ static const struct wl_callback_listener xcursor_listener = { .done = &xcursor_callback, }; +bool +render_xcursor_is_valid(const struct seat *seat, const char *cursor) +{ + if (cursor == NULL) + return false; + return wl_cursor_theme_get_cursor(seat->pointer.theme, cursor) != NULL; +} + static void render_xcursor_update(struct seat *seat) { -- cgit v1.3