Browse Source

Update SDL_mouse.c

expikr 5 months ago
parent
commit
e2857fc5a2
2 changed files with 6 additions and 3 deletions
  1. 4 3
      include/SDL3/SDL_hints.h
  2. 2 0
      src/events/SDL_mouse.c

+ 4 - 3
include/SDL3/SDL_hints.h

@@ -2509,9 +2509,10 @@ extern "C" {
  * A variable controlling whether the hardware cursor stays visible when
  * relative mode is active.
  *
- * This variable can be set to the following values: "0" - The cursor will be
- * hidden while relative mode is active (default) "1" - The cursor will remain
- * visible while relative mode is active
+ * This variable can be set to the following values: 
+ *
+ * - "0" - The cursor will be hidden while relative mode is active (default) 
+ * - "1" - The cursor will remain visible while relative mode is active
  *
  * Note that for systems without raw hardware inputs, relative mode is
  * implemented using warping, so the hardware cursor will visibly warp between

+ 2 - 0
src/events/SDL_mouse.c

@@ -200,6 +200,8 @@ static void SDLCALL SDL_MouseRelativeCursorVisibleChanged(void *userdata, const
     SDL_Mouse *mouse = (SDL_Mouse *)userdata;
 
     mouse->relative_mode_cursor_visible = SDL_GetStringBoolean(hint, false);
+    
+    SDL_SetCursor(NULL); // Update cursor visibility
 }
 
 // Public functions