http://bugs.winehq.org/show_bug.cgi?id=18371
--- Comment #3 from Daniel Santos daniel.santos@pobox.com 2009-05-17 14:29:12 --- When the app's window is deactivated, it responsibly calls LoadCursor(NULL, IDC_ARROW) to get the default arrow cursor and then calls SetCursor() passing the result and saving the return value, or otherwise remembering the handle to the previous cursor. However, it then irresponsibly calls DestroyCursor, passing the handle to the old cursor. This would be fine, except that when a mouse move event is sent to the window, it calls SetCursor() passing that old handle.
I haven't tested this behavior on windows yet, but the current wine SetCursor implementation fails to verify that the handle passed is valid and that it is even a handle to an object that can be used as a cursor. Instead, if the handle is invalid, then it clears the cursor (same as calling SetCursor(NULL)), this is incorrect behavior. I'm also getting that calling SetCursor and passing a handle to an object that is not a valid cursor can result in undefined behavior that would not occur on windows, as the msdn docs claim the call will fail if it isn't a handle to a cursor.
I'll post & submit a patch once I've tested this behavior further on windows. I'm probably also going to submit a second patch that cleans up similar problems in other areas of user32