Skip to content

Commit d553372

Browse files
expikrslouken
authored andcommitted
rename cursor_shown to cursor_visible
1 parent 016ba86 commit d553372

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/events/SDL_mouse.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ bool SDL_PreInitMouse(void)
304304

305305
mouse->was_touch_mouse_events = false; // no touch to mouse movement event pending
306306

307-
mouse->cursor_shown = true;
307+
mouse->cursor_visible = true;
308308

309309
return true;
310310
}
@@ -812,7 +812,7 @@ static void SDL_PrivateSendMouseMotion(Uint64 timestamp, SDL_Window *window, SDL
812812
}
813813

814814
// Move the mouse cursor, if needed
815-
if (mouse->cursor_shown && !mouse->relative_mode &&
815+
if (mouse->cursor_visible && !mouse->relative_mode &&
816816
mouse->MoveCursor && mouse->cur_cursor) {
817817
mouse->MoveCursor(mouse->cur_cursor);
818818
}
@@ -1289,7 +1289,7 @@ static void SDL_MaybeEnableWarpEmulation(SDL_Window *window, float x, float y)
12891289
{
12901290
SDL_Mouse *mouse = SDL_GetMouse();
12911291

1292-
if (!mouse->warp_emulation_prohibited && mouse->warp_emulation_hint && !mouse->cursor_shown && !mouse->warp_emulation_active) {
1292+
if (!mouse->warp_emulation_prohibited && mouse->warp_emulation_hint && !mouse->cursor_visible && !mouse->warp_emulation_active) {
12931293
if (!window) {
12941294
window = mouse->focus;
12951295
}
@@ -1635,7 +1635,7 @@ bool SDL_SetCursor(SDL_Cursor *cursor)
16351635
}
16361636
}
16371637

1638-
if (cursor && (!mouse->focus || (mouse->cursor_shown && (!mouse->relative_mode || mouse->relative_mode_cursor_visible)))) {
1638+
if (cursor && (!mouse->focus || (mouse->cursor_visible && (!mouse->relative_mode || mouse->relative_mode_cursor_visible)))) {
16391639
if (mouse->ShowCursor) {
16401640
mouse->ShowCursor(cursor);
16411641
}
@@ -1711,8 +1711,8 @@ bool SDL_ShowCursor(void)
17111711
mouse->warp_emulation_active = false;
17121712
}
17131713

1714-
if (!mouse->cursor_shown) {
1715-
mouse->cursor_shown = true;
1714+
if (!mouse->cursor_visible) {
1715+
mouse->cursor_visible = true;
17161716
SDL_SetCursor(NULL);
17171717
}
17181718
return true;
@@ -1722,8 +1722,8 @@ bool SDL_HideCursor(void)
17221722
{
17231723
SDL_Mouse *mouse = SDL_GetMouse();
17241724

1725-
if (mouse->cursor_shown) {
1726-
mouse->cursor_shown = false;
1725+
if (mouse->cursor_visible) {
1726+
mouse->cursor_visible = false;
17271727
SDL_SetCursor(NULL);
17281728
}
17291729
return true;
@@ -1733,5 +1733,5 @@ bool SDL_CursorVisible(void)
17331733
{
17341734
SDL_Mouse *mouse = SDL_GetMouse();
17351735

1736-
return mouse->cursor_shown;
1736+
return mouse->cursor_visible;
17371737
}

src/events/SDL_mouse_c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ typedef struct
148148
SDL_Cursor *cursors;
149149
SDL_Cursor *def_cursor;
150150
SDL_Cursor *cur_cursor;
151-
bool cursor_shown;
151+
bool cursor_visible;
152152

153153
// Driver-dependent data.
154154
void *internal;

src/video/cocoa/SDL_cocoawindow.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ static void Cocoa_WaitForMiniaturizable(SDL_Window *window)
743743
{
744744
SDL_Mouse *mouse = SDL_GetMouse();
745745

746-
if (mouse->cursor_shown && mouse->cur_cursor && !mouse->relative_mode) {
746+
if (mouse->cursor_visible && mouse->cur_cursor && !mouse->relative_mode) {
747747
return (__bridge NSCursor *)mouse->cur_cursor->internal;
748748
}
749749

src/video/kmsdrm/SDL_kmsdrmmouse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static void KMSDRM_FreeCursor(SDL_Cursor *cursor);
5050
// KMSDRM_ShowCursor() simply shows or hides the cursor it receives: it does NOT
5151
// mind if it's mouse->cur_cursor, etc.
5252
// -If KMSDRM_ShowCursor() returns successfully, that cursor becomes
53-
// mouse->cur_cursor and mouse->cursor_shown is 1.
53+
// mouse->cur_cursor and mouse->cursor_visible is 1.
5454
/**************************************************************************************/
5555

5656
static SDL_Cursor *KMSDRM_CreateDefaultCursor(void)

src/video/wayland/SDL_waylandmouse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ void Wayland_RecreateCursors(void)
10251025
}
10261026
if (mouse->cur_cursor) {
10271027
Wayland_RecreateCursor(mouse->cur_cursor, vdata);
1028-
if (mouse->cursor_shown) {
1028+
if (mouse->cursor_visible) {
10291029
Wayland_ShowCursor(mouse->cur_cursor);
10301030
}
10311031
}

0 commit comments

Comments
 (0)