Default to default cursor if cursor not found

This commit is contained in:
dec05eba
2025-01-27 11:53:49 +01:00
parent 3cb156aecb
commit d73bd68a70
2 changed files with 15 additions and 2 deletions

5
TODO
View File

@@ -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. 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? 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.

View File

@@ -772,9 +772,19 @@ namespace gsr {
if(cursor_size <= 1) if(cursor_size <= 1)
cursor_size = 24; 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) { if(!cursor_image) {
fprintf(stderr, "Error: failed to get cursor\n"); fprintf(stderr, "Error: failed to get cursor\n");
XFixesShowCursor(xi_display, DefaultRootWindow(xi_display));
XFlush(xi_display);
return; return;
} }