[WIN32K]
[reactos.git] / reactos / subsystems / win32 / win32k / ntuser / msgqueue.c
index 3a4a9d4..a3a1254 100644 (file)
@@ -2094,9 +2094,19 @@ MsqCleanupMessageQueue(PUSER_MESSAGE_QUEUE MessageQueue)
    {
        PCURICON_OBJECT pCursor = MessageQueue->CursorObject;
 
-       /* Change to another cursor if we going to dereference current one */
+       /* Change to another cursor if we going to dereference current one
+          Note: we can't use UserSetCursor because it uses current thread
+                message queue instead of queue given for cleanup */
        if (IntGetSysCursorInfo()->CurrentCursorObject == pCursor)
-           UserSetCursor(NULL, TRUE);
+       {
+           HDC hdcScreen;
+
+           /* Get the screen DC */
+           hdcScreen = IntGetScreenDC();
+           if (hdcScreen)
+               GreMovePointer(hdcScreen, -1, -1);
+           IntGetSysCursorInfo()->CurrentCursorObject = NULL;
+       }
 
        UserDereferenceObject(pCursor);
    }