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!
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1250
Used LCG algorithm and its parameters are documented in various places. Parts that were not obvious - negative argument handling in Rnd(), and Randomize() use of current state were taken from LGPL2 FreeBASIC rtlib.
--
v2: vbscript: Implement PRNG functions.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1246