[SDL] Fixed MouseCursor getting stuck after multiple changes

This commit is contained in:
thefiddler 2014-04-30 13:46:44 +02:00
parent a5ddc530c2
commit 8568e6dc70

View file

@ -470,7 +470,7 @@ namespace OpenTK.Platform.SDL2
{ {
lock (sync) lock (sync)
{ {
if (value != MouseCursor.Default) if (cursor != value)
{ {
// Free the previous cursor, // Free the previous cursor,
// if one has been set. // if one has been set.
@ -478,7 +478,6 @@ namespace OpenTK.Platform.SDL2
{ {
SDL.FreeCursor(sdl_cursor); SDL.FreeCursor(sdl_cursor);
sdl_cursor = IntPtr.Zero; sdl_cursor = IntPtr.Zero;
cursor = MouseCursor.Default;
} }
// Set the new cursor // Set the new cursor
@ -486,6 +485,7 @@ namespace OpenTK.Platform.SDL2
{ {
// Reset to default cursor // Reset to default cursor
SDL.SetCursor(SDL.GetDefaultCursor()); SDL.SetCursor(SDL.GetDefaultCursor());
cursor = value;
} }
else else
{ {