mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-21 09:11:49 +00:00
Setting the same mouse cursor twice is a no-op
This fixes extremely poor event polling performance on MacOS when using Dear ImGui, which sets the mouse cursor every frame.
This commit is contained in:

committed by
Ryan C. Gordon

parent
5b5a72e33c
commit
af5efadd9f
@@ -1333,6 +1333,11 @@ void SDL_SetCursor(SDL_Cursor *cursor)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
/* Return immediately if setting the cursor to the currently set one (fixes #7151) */
|
||||
if (cursor == mouse->cur_cursor) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Set the new cursor */
|
||||
if (cursor) {
|
||||
/* Make sure the cursor is still valid for this mouse */
|
||||
|
Reference in New Issue
Block a user