From 44f66b5c8bc835aff0cd695e2b5e3848b9480803 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 10 Jun 2024 14:56:16 -0700 Subject: [PATCH] Show the cursor when relative mode is enabled and the app doesn't have focus Testing: * Run test/testwm * Hit Ctrl-R to toggle relative mode * Alt-tab away * Move the mouse over testwm * Note that the cursor is visible until testwm gains focus --- src/events/SDL_mouse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index 832173cd73..476959eccc 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -1541,7 +1541,7 @@ int SDL_SetCursor(SDL_Cursor *cursor) } } - if (cursor && mouse->cursor_shown && !mouse->relative_mode) { + if (cursor && (!mouse->focus || (mouse->cursor_shown && !mouse->relative_mode))) { if (mouse->ShowCursor) { mouse->ShowCursor(cursor); }