diff options
author | dec05eba <dec05eba@protonmail.com> | 2025-01-27 17:35:35 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2025-01-27 17:35:35 +0100 |
commit | 309cc3425b67e3cf6d854ba42d54503a95963f92 (patch) | |
tree | bd02b17307b22f3ed51246feec5b73b79a2cafb6 /src/Overlay.cpp | |
parent | 81cb8f539f284ed0dce95a2ddd6ff0a031c348a6 (diff) |
Diffstat (limited to 'src/Overlay.cpp')
-rw-r--r-- | src/Overlay.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/Overlay.cpp b/src/Overlay.cpp index 14564e9..f542374 100644 --- a/src/Overlay.cpp +++ b/src/Overlay.cpp @@ -774,15 +774,26 @@ namespace gsr { XcursorImage *cursor_image = nullptr; for(int cursor_size_test : {cursor_size, 24}) { - for(const char *cursor_theme_test : {cursor_theme, "default"}) { + for(const char *cursor_theme_test : {cursor_theme, "default", "Adwaita"}) { for(unsigned int shape : {XC_left_ptr, XC_arrow}) { cursor_image = XcursorShapeLoadImage(shape, cursor_theme_test, cursor_size_test); if(cursor_image) - break; + goto done; } } } + done: + if(!cursor_image) { + fprintf(stderr, "Error: failed to get cursor, loading bundled default cursor instead\n"); + const std::string default_cursor_path = resources_path + "images/default.cur"; + for(int cursor_size_test : {cursor_size, 24}) { + cursor_image = XcursorFilenameLoadImage(default_cursor_path.c_str(), cursor_size_test); + if(cursor_image) + break; + } + } + if(!cursor_image) { fprintf(stderr, "Error: failed to get cursor\n"); XFixesShowCursor(xi_display, DefaultRootWindow(xi_display)); |