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 - Add a function for getting the default cursor
Summary: Add a function for getting the default cursor
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.0
Hardware: All All
: P2 enhancement
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-11 20:24 UTC by Alex Szpakowski
Modified: 2013-04-24 13:51 UTC (History)
1 user (show)

See Also:


Attachments
Patch to add SDL_GetDefaultCursor to SDL_mouse (886 bytes, application/octet-stream)
2013-04-11 20:24 UTC, Alex Szpakowski
Details

Note You need to log in before you can comment on or make changes to this bug.
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