File tree Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -1607,7 +1607,7 @@ bool SDL_SetCursor(SDL_Cursor *cursor)
1607
1607
{
1608
1608
SDL_Mouse * mouse = SDL_GetMouse ();
1609
1609
1610
- // Return immediately if setting the cursor to the currently set one (fixes #7151)
1610
+ // already on this cursor, no further action required
1611
1611
if (cursor == mouse -> cur_cursor ) {
1612
1612
return true;
1613
1613
}
@@ -1627,23 +1627,20 @@ bool SDL_SetCursor(SDL_Cursor *cursor)
1627
1627
}
1628
1628
}
1629
1629
mouse -> cur_cursor = cursor ;
1630
+ } else if (mouse -> focus ) {
1631
+ cursor = mouse -> cur_cursor ;
1630
1632
} else {
1631
- if (mouse -> focus ) {
1632
- cursor = mouse -> cur_cursor ;
1633
- } else {
1634
- cursor = mouse -> def_cursor ;
1635
- }
1633
+ cursor = mouse -> def_cursor ;
1636
1634
}
1637
1635
1638
- if (cursor && (!mouse -> focus || (mouse -> cursor_visible && (!mouse -> relative_mode || !mouse -> relative_mode_hide_cursor )))) {
1639
- if (mouse -> ShowCursor ) {
1640
- mouse -> ShowCursor (cursor );
1641
- }
1642
- } else {
1643
- if (mouse -> ShowCursor ) {
1644
- mouse -> ShowCursor (NULL );
1645
- }
1636
+ if (mouse -> focus && (!mouse -> cursor_visible || (mouse -> relative_mode && mouse -> relative_mode_hide_cursor ))) {
1637
+ cursor = NULL ;
1638
+ }
1639
+
1640
+ if (mouse -> ShowCursor ) {
1641
+ mouse -> ShowCursor (cursor );
1646
1642
}
1643
+
1647
1644
return true;
1648
1645
}
1649
1646
You can’t perform that action at this time.
0 commit comments