-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cursor drift when the config overlay is active #342
Comments
Is it drifting constantly, or only occasionally while moving the mouse? If it's the latter, I can reproduce it, though it's in a random direction during active mouse movement and pretty rare. Maybe it's easier to reproduce with high polling rate mouse. The game periodically calls SetCursorPos after every flip (no idea what for), and the mouse hook is temporarily uninstalled and reinstalled during that, which might allow for a mouse move event to slip through unblocked.
This I have never seen. Please enable CrashDump=full, it might produce a usable dump file next time it happens. If it's easy to reproduce, LogLevel=debug could also be useful. |
I've made some further tests, and this is related to DPI scaling. Please set the DPI scale factor to 150% or 125% ( The drift is constant and does not depend on any mouse movement, the game cursor moves even if the overlay cursor is not moved at all. The drift starts immediately after opening the config overlay. My mouse allows switching the polling rates, and it does not seem to affect the drift speed. Debug log: DDrawCompat-VRDMfc.zip The main thread stack from the crash dump is:
Just a wild guess, but is the case of the overlay being dismissed while the mouse hook is temporarily disabled handled correctly? I noticed that in the case of a crash, the cursor will continue to drift for a while after I dismiss the overlay until a crash occurs. In the lucky case, the cursor will stop moving immediately after closing the overlay. |
Of course, that was one of my first ideas too, but it wasn't enough. Based on your logs, I assume you have changed the game's Hardware Configuration to "No page flipping". With that, I can reproduce the cursor drift now.
That doesn't look like something that crashed, it's just waiting for the DirectDraw critical section. The crash must have happened on a different thread. Debug logs might indicate which one. Anyway, even without page flipping and with high DPI scaling, I can't reproduce it. I pressed shift+f12 continuously for a few minutes so that the overlay rapidly turns on and off, but no crashes. |
Yes, as mentioned at #306 (comment), "No page flipping" is the only configuration option that delivers a perfectly smooth 60 FPS animation when DDrawCompat is used (bar a special case or two, but I digress). The exact steps I use to reproduce the crash: on the main menu screen, press SHIFT+F11 to open the overlay screen. After a random amount of time (1/2/3 seconds), press SHIFT+F11 to dismiss. If the cursor continues to drift even with the overlay closed, it will crash as soon as you move the mouse (this is a detail I missed, moving the mouse is necessary after all). If the drift doesn't continue -> bring up the overlay again to retry. A minor detail I just noticed: when the cursor continues the drift with the overlay closed, instead of moving the mouse, I can bring up the overlay again and avoid the crash. Please remember to use I've just figured out I can use
Stack trace:
Looks like EDIT: the mouse hook is installed asynchronously:
So there's no guarantee that |
Thanks, both issues should be fixed in v0.5.4 now. The cursor will still drift when moving the mouse while the config overlay is open, which seems to be a side effect of the frequent GetCursorPos/SetCursorPos calls, combined with the general cursor position inaccuracy of DPI unaware mode. The cursor is not supposed to be able to move at all when LowLevelMouseProc returns 1, but apparently this isn't quite working correctly in this case. I can't do much about it, but it also doesn't seem to cause any other serious problems. |
I noticed that when I open the config overlay in Wild Wild West: The Steel Assassin, the game cursor will drift to the lower right corner. This reminded me of a comment I read at #338 (comment) :
I'm not sure if this behavior is a result of some event not being caught/redirected properly or rather the game acting weird in the absence of some expected input event, but I thought I'd report it anyway, especially that the game will occasionally crash when the config overlay is dismissed.
The text was updated successfully, but these errors were encountered: