We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1798

Summary: Add a function for getting the default cursor
Product: SDL Reporter: Alex Szpakowski <amaranth72>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: enhancement    
Priority: P2 CC: jorgen
Version: HG 2.0   
Hardware: All   
OS: All   
Attachments: Patch to add SDL_GetDefaultCursor to SDL_mouse

Description Alex Szpakowski 2013-04-11 20:24:48 UTC
Created attachment 1108 [details]
Patch to add SDL_GetDefaultCursor to SDL_mouse

Currently there is no way to get the default mouse cursor, even though it's always stored internally.
There is often reason for switching back to the default after using a custom cursor for a short time, and while it's possible to manually save the default cursor by calling SDL_GetCursor() before any SDL_SetCursor is called, it's not particularly intuitive and makes for slightly messier code.

Adding SDL_GetDefaultCursor is trivial and makes the API more complete in my eyes. Calling SDL_FreeCursor on the default cursor is already handled as an early return by SDL_FreeCursor, so that's not an issue.

I've attached a diff patch to add the function.
Comment 1 (disabled) Jørgen Tjernø 2013-04-24 13:51:32 UTC
Fixed in http://hg.libsdl.org/SDL/rev/4e4ca313000c