Skip to content

Commit 510c7ed

Browse files
expikrslouken
authored andcommitted
migrate usage of SetCursor(NULL) to RedrawCursor()
1 parent 4779499 commit 510c7ed

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/events/SDL_mouse.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ static void SDLCALL SDL_MouseRelativeCursorVisibleChanged(void *userdata, const
231231

232232
mouse->relative_mode_hide_cursor = !(SDL_GetStringBoolean(hint, false));
233233

234-
SDL_SetCursor(NULL); // Update cursor visibility
234+
SDL_RedrawCursor(); // Update cursor visibility
235235
}
236236

237237
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)
606606
}
607607

608608
// Update cursor visibility
609-
SDL_SetCursor(NULL);
609+
SDL_RedrawCursor();
610610
}
611611

612612
bool SDL_MousePositionInWindow(SDL_Window *window, float x, float y)
@@ -1360,7 +1360,7 @@ bool SDL_SetRelativeMouseMode(bool enabled)
13601360

13611361
if (enabled) {
13621362
// Update cursor visibility before we potentially warp the mouse
1363-
SDL_SetCursor(NULL);
1363+
SDL_RedrawCursor();
13641364
}
13651365

13661366
if (enabled && focusWindow) {
@@ -1380,7 +1380,7 @@ bool SDL_SetRelativeMouseMode(bool enabled)
13801380

13811381
if (!enabled) {
13821382
// Update cursor visibility after we restore the mouse position
1383-
SDL_SetCursor(NULL);
1383+
SDL_RedrawCursor();
13841384
}
13851385

13861386
// Flush pending mouse motion - ideally we would pump events, but that's not always safe
@@ -1720,7 +1720,7 @@ bool SDL_ShowCursor(void)
17201720

17211721
if (!mouse->cursor_visible) {
17221722
mouse->cursor_visible = true;
1723-
SDL_SetCursor(NULL);
1723+
SDL_RedrawCursor();
17241724
}
17251725
return true;
17261726
}
@@ -1731,7 +1731,7 @@ bool SDL_HideCursor(void)
17311731

17321732
if (mouse->cursor_visible) {
17331733
mouse->cursor_visible = false;
1734-
SDL_SetCursor(NULL);
1734+
SDL_RedrawCursor();
17351735
}
17361736
return true;
17371737
}

src/video/riscos/SDL_riscosmodes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ bool RISCOS_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SD
302302
}
303303

304304
// Update cursor visibility, since it may have been disabled by the mode change.
305-
SDL_SetCursor(NULL);
305+
SDL_RedrawCursor();
306306

307307
return true;
308308
}

src/video/wayland/SDL_waylandmouse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static DBusHandlerResult Wayland_DBusCursorMessageFilter(DBusConnection *conn, D
196196

197197
if (dbus_cursor_size != new_cursor_size) {
198198
dbus_cursor_size = new_cursor_size;
199-
SDL_SetCursor(NULL); // Force cursor update
199+
SDL_RedrawCursor(); // Force cursor update
200200
}
201201
} else if (SDL_strcmp(CURSOR_THEME_KEY, key) == 0) {
202202
const char *new_cursor_theme = NULL;
@@ -223,7 +223,7 @@ static DBusHandlerResult Wayland_DBusCursorMessageFilter(DBusConnection *conn, D
223223

224224
// Purge the current cached themes and force a cursor refresh.
225225
Wayland_FreeCursorThemes(vdata);
226-
SDL_SetCursor(NULL);
226+
SDL_RedrawCursor();
227227
}
228228
} else {
229229
goto not_our_signal;

src/video/x11/SDL_x11mouse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ void X11_QuitMouse(SDL_VideoDevice *_this)
552552
void X11_SetHitTestCursor(SDL_HitTestResult rc)
553553
{
554554
if (rc == SDL_HITTEST_NORMAL || rc == SDL_HITTEST_DRAGGABLE) {
555-
SDL_SetCursor(NULL);
555+
SDL_RedrawCursor();
556556
} else {
557557
X11_ShowCursor(sys_cursors[rc]);
558558
}

0 commit comments

Comments
 (0)