diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index 80d9439e39..e2e9e4abc6 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -231,7 +231,7 @@ static void SDLCALL SDL_MouseRelativeCursorVisibleChanged(void *userdata, const mouse->relative_mode_hide_cursor = !(SDL_GetStringBoolean(hint, false)); - SDL_SetCursor(NULL); // Update cursor visibility + SDL_RedrawCursor(); // Update cursor visibility } static void SDLCALL SDL_MouseIntegerModeChanged(void *userdata, const char *name, const char *oldValue, const char *hint) @@ -606,7 +606,7 @@ void SDL_SetMouseFocus(SDL_Window *window) } // Update cursor visibility - SDL_SetCursor(NULL); + SDL_RedrawCursor(); } bool SDL_MousePositionInWindow(SDL_Window *window, float x, float y) @@ -1360,7 +1360,7 @@ bool SDL_SetRelativeMouseMode(bool enabled) if (enabled) { // Update cursor visibility before we potentially warp the mouse - SDL_SetCursor(NULL); + SDL_RedrawCursor(); } if (enabled && focusWindow) { @@ -1380,7 +1380,7 @@ bool SDL_SetRelativeMouseMode(bool enabled) if (!enabled) { // Update cursor visibility after we restore the mouse position - SDL_SetCursor(NULL); + SDL_RedrawCursor(); } // Flush pending mouse motion - ideally we would pump events, but that's not always safe @@ -1720,7 +1720,7 @@ bool SDL_ShowCursor(void) if (!mouse->cursor_visible) { mouse->cursor_visible = true; - SDL_SetCursor(NULL); + SDL_RedrawCursor(); } return true; } @@ -1731,7 +1731,7 @@ bool SDL_HideCursor(void) if (mouse->cursor_visible) { mouse->cursor_visible = false; - SDL_SetCursor(NULL); + SDL_RedrawCursor(); } return true; } diff --git a/src/video/riscos/SDL_riscosmodes.c b/src/video/riscos/SDL_riscosmodes.c index d4e9a5345b..05da04634e 100644 --- a/src/video/riscos/SDL_riscosmodes.c +++ b/src/video/riscos/SDL_riscosmodes.c @@ -302,7 +302,7 @@ bool RISCOS_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SD } // Update cursor visibility, since it may have been disabled by the mode change. - SDL_SetCursor(NULL); + SDL_RedrawCursor(); return true; } diff --git a/src/video/wayland/SDL_waylandmouse.c b/src/video/wayland/SDL_waylandmouse.c index b7662e4798..59f91b6b9f 100644 --- a/src/video/wayland/SDL_waylandmouse.c +++ b/src/video/wayland/SDL_waylandmouse.c @@ -196,7 +196,7 @@ static DBusHandlerResult Wayland_DBusCursorMessageFilter(DBusConnection *conn, D if (dbus_cursor_size != new_cursor_size) { dbus_cursor_size = new_cursor_size; - SDL_SetCursor(NULL); // Force cursor update + SDL_RedrawCursor(); // Force cursor update } } else if (SDL_strcmp(CURSOR_THEME_KEY, key) == 0) { const char *new_cursor_theme = NULL; @@ -223,7 +223,7 @@ static DBusHandlerResult Wayland_DBusCursorMessageFilter(DBusConnection *conn, D // Purge the current cached themes and force a cursor refresh. Wayland_FreeCursorThemes(vdata); - SDL_SetCursor(NULL); + SDL_RedrawCursor(); } } else { goto not_our_signal; diff --git a/src/video/x11/SDL_x11mouse.c b/src/video/x11/SDL_x11mouse.c index 343d865445..6cfe1c0501 100644 --- a/src/video/x11/SDL_x11mouse.c +++ b/src/video/x11/SDL_x11mouse.c @@ -552,7 +552,7 @@ void X11_QuitMouse(SDL_VideoDevice *_this) void X11_SetHitTestCursor(SDL_HitTestResult rc) { if (rc == SDL_HITTEST_NORMAL || rc == SDL_HITTEST_DRAGGABLE) { - SDL_SetCursor(NULL); + SDL_RedrawCursor(); } else { X11_ShowCursor(sys_cursors[rc]); }