USER32: Hide cursor when calling SetCursor with NULL HCURSOR (Try 2)

Justin Chevrier jchevrier at
Wed Feb 15 20:57:49 CST 2006

Here it is again with fixes. The aim of this patch is to hide the X cursor 
when a program calls SetCursor with a NULL HCURSOR (as per:
). This is to correct behavior as seen in Master of Orion 2. This may also 
(unconfirmed) correct bug: 881.

One issue that I ran into was that Windows sets the initial cursor of a 
process to IDC_WAIT whereas we start off pointing to no cursor (NULL). This 
causes an issue in SetCursor that if the cursor is hidden with 
SetCursor(NULL) before any other calls to SetCursor occur than Wine thinks  
the cursor hasn't changed and just exits the function without doing anything 
(namely hiding the cursor). I have matched Windows' behavior here and set 
Wine's initial cursor to IDC_WAIT. SetCursor then works correctly if a 
program calls SetCursor(NULL) immediately. I have included a test case that 
shows Windows' behavior here.

- Hide cursor if SetCursor is called with a NULL HCURSOR
- Set initial cursor of a process to IDC_WAIT
- Test case showing correctness of starting process with cursor set to 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cursor_hide.diff
Type: text/x-diff
Size: 3641 bytes
Desc: not available
Url :

More information about the wine-patches mailing list