The server's idea of the cursor position is never really initialized. Normally that's not a problem, since the first mouse movement and a number of other X events will update it. But in the case where the user never moves the mouse, it can remain out of sync. That manifests as `GetCursorPos` bouncing between the server's incorrect value and the real one from the user driver, depending on the age of the position on the server.
I've marked this as a draft for two reasons:
1. I don't quite know where this belongs. We want to do it early in the lifespan of a user driver but after there's a desktop, so I've put it behind a `pthread_once` called from `get_desktop_window`.
2. I'm calling `NtUserSetCursorPos` to update the server, rather than a direct `set_cursor` request, because it contains some DPI logic. That has the side effect of potentially warping the cursor. That's not desirable or necessary, but it shouldn't be a problem. It's easily factored around if we want to avoid it.
Any guidance would be greatly appreciated!
--
v2: win32u: Initialize the server's cursor position from the user driver's.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1250
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53741
--
v2: ntdll: Implement RtlSetUserFlagsHeap.
ntdll: Check block user flags in RtlGetUserInfoHeap.
ntdll: Check block user flags in RtlSetUserValueHeap.
ntdll: Store the user flags in the heap block flags.
ntdll: Introduce a new heap block_set_flags helper.
kernel32/tests: Test (Global|Local)Handle with heap allocated pointers.
kernel32/tests: Test more Global/Local functions with invalid pointers.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1312