|
@@ -170,6 +170,13 @@ static void SDLCALL SDL_MouseRelativeWarpMotionChanged(void *userdata, const cha
|
|
|
mouse->relative_mode_warp_motion = SDL_GetStringBoolean(hint, SDL_FALSE);
|
|
|
}
|
|
|
|
|
|
+static void SDLCALL SDL_MouseRelativeCursorVisibleChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
|
|
|
+{
|
|
|
+ SDL_Mouse *mouse = (SDL_Mouse *)userdata;
|
|
|
+
|
|
|
+ mouse->relative_mode_cursor_visible = SDL_GetStringBoolean(hint, SDL_FALSE);
|
|
|
+}
|
|
|
+
|
|
|
/* Public functions */
|
|
|
int SDL_MousePreInit(void)
|
|
|
{
|
|
@@ -209,6 +216,9 @@ int SDL_MousePreInit(void)
|
|
|
SDL_AddHintCallback(SDL_HINT_MOUSE_RELATIVE_WARP_MOTION,
|
|
|
SDL_MouseRelativeWarpMotionChanged, mouse);
|
|
|
|
|
|
+ SDL_AddHintCallback(SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE,
|
|
|
+ SDL_MouseRelativeCursorVisibleChanged, mouse);
|
|
|
+
|
|
|
mouse->was_touch_mouse_events = SDL_FALSE; /* no touch to mouse movement event pending */
|
|
|
|
|
|
mouse->cursor_shown = SDL_TRUE;
|
|
@@ -992,6 +1002,9 @@ void SDL_MouseQuit(void)
|
|
|
|
|
|
SDL_DelHintCallback(SDL_HINT_MOUSE_RELATIVE_WARP_MOTION,
|
|
|
SDL_MouseRelativeWarpMotionChanged, mouse);
|
|
|
+
|
|
|
+ SDL_DelHintCallback(SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE,
|
|
|
+ SDL_MouseRelativeCursorVisibleChanged, mouse);
|
|
|
}
|
|
|
|
|
|
Uint32 SDL_GetMouseState(int *x, int *y)
|
|
@@ -1412,7 +1425,7 @@ void SDL_SetCursor(SDL_Cursor *cursor)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (cursor && mouse->cursor_shown && !mouse->relative_mode) {
|
|
|
+ if (cursor && mouse->cursor_shown && (!mouse->relative_mode || mouse->relative_mode_cursor_visible)) {
|
|
|
if (mouse->ShowCursor) {
|
|
|
mouse->ShowCursor(cursor);
|
|
|
}
|