From f02d3ef28bc908d1c9f01647b55fbc705a6b8373 Mon Sep 17 00:00:00 2001 From: M Stoeckl Date: Tue, 26 Nov 2024 18:55:11 -0500 Subject: [PATCH] wlr_cursor: use default shape if requested shape missing (cherry picked from commit b97106ddcbca4d04a708bd5c5a624745cda934e4) --- types/wlr_cursor.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/types/wlr_cursor.c b/types/wlr_cursor.c index 77ab2fb70..5a978ac99 100644 --- a/types/wlr_cursor.c +++ b/types/wlr_cursor.c @@ -574,9 +574,15 @@ static void cursor_output_cursor_update(struct wlr_cursor_output_cursor *output_ wlr_xcursor_manager_load(manager, scale); struct wlr_xcursor *xcursor = wlr_xcursor_manager_get_xcursor(manager, name, scale); if (xcursor == NULL) { - wlr_log(WLR_DEBUG, "XCursor theme is missing '%s' cursor", name); - wlr_output_cursor_set_buffer(output_cursor->output_cursor, NULL, 0, 0); - return; + /* Try the default cursor: better the wrong image than an invisible + * (and therefore practically unusable) cursor */ + wlr_log(WLR_DEBUG, "XCursor theme is missing '%s' cursor, falling back to 'default'", name); + xcursor = wlr_xcursor_manager_get_xcursor(manager, "default", scale); + if (xcursor == NULL) { + wlr_log(WLR_DEBUG, "XCursor theme is missing a 'default' cursor"); + wlr_output_cursor_set_buffer(output_cursor->output_cursor, NULL, 0, 0); + return; + } } output_cursor->xcursor = xcursor;