From d73bd68a708c997d12ce770ca0a96de38be0735f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 27 Jan 2025 11:53:49 +0100 Subject: Default to default cursor if cursor not found --- TODO | 5 ++++- src/Overlay.cpp | 12 +++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index 8b9cad0..221a9f9 100644 --- a/TODO +++ b/TODO @@ -107,4 +107,7 @@ When adding window capture only add it to recording and streaming and do the win Show an error that prime run will be disabled when using desktop portal capture option. This can cause issues as the user may have selected a video codec option that isn't available on their iGPU but is available on the prime-run dGPU. -Is it possible to configure hotkey and the new hotkey to get triggered immediately? \ No newline at end of file +Is it possible to configure hotkey and the new hotkey to get triggered immediately? + +For keyboards that report supporting mice the keyboard grab will be delayed until any key has been pressed (and then released), see: https://github.com/dec05eba/gpu-screen-recorder-issues/issues/97 + See if there is any way around this. diff --git a/src/Overlay.cpp b/src/Overlay.cpp index c8e8b8f..23ff1c9 100644 --- a/src/Overlay.cpp +++ b/src/Overlay.cpp @@ -772,9 +772,19 @@ namespace gsr { if(cursor_size <= 1) cursor_size = 24; - XcursorImage *cursor_image = XcursorShapeLoadImage(XC_left_ptr, cursor_theme, cursor_size); + XcursorImage *cursor_image = nullptr; + for(const char *cursor_theme_test : {cursor_theme, "default"}) { + for(unsigned int shape : {XC_left_ptr, XC_right_ptr}) { + cursor_image = XcursorShapeLoadImage(shape, cursor_theme_test, cursor_size); + if(cursor_image) + break; + } + } + if(!cursor_image) { fprintf(stderr, "Error: failed to get cursor\n"); + XFixesShowCursor(xi_display, DefaultRootWindow(xi_display)); + XFlush(xi_display); return; } -- cgit v1.2.3