aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--images/default.curbin0 -> 69120 bytes
-rw-r--r--src/Overlay.cpp15
3 files changed, 14 insertions, 3 deletions
diff --git a/README.md b/README.md
index a28bcc3..dd9805d 100644
--- a/README.md
+++ b/README.md
@@ -39,7 +39,7 @@ This program has to grab all keyboards and create a virtual keyboard (`gsr-ui vi
This might cause issues for you if you use input remapping software. To workaround this you can go into settings and select "Only grab virtual devices"
# License
-This software is licensed under GPL3.0-only. Files under `fonts/` directory belong to the Noto Sans Google fonts project and they are licensed under `SIL Open Font License`.
+This software is licensed under GPL3.0-only. Files under `fonts/` directory belong to the Noto Sans Google fonts project and they are licensed under `SIL Open Font License`. `images/default.cur` it part of the [Adwaita icon theme](https://gitlab.gnome.org/GNOME/adwaita-icon-theme/-/tree/master) which is licensed under `Creative Commons Attribution-Share Alike 3.0`.
# Demo
[![Click here to watch a demo video on youtube](https://img.youtube.com/vi/SOqXusCTXXA/0.jpg)](https://www.youtube.com/watch?v=SOqXusCTXXA)
diff --git a/images/default.cur b/images/default.cur
new file mode 100644
index 0000000..c7da315
--- /dev/null
+++ b/images/default.cur
Binary files differ
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));