After spending a while in front of the code, I have a suspicion about the root cause. I'm basing this on r27167 and r27172 (both between 1.4.x and 1.5.0; I found them before reading tomb's message) which were supposed to fix rightclick scrolling. The underlying issue is that rightclick scrolling locks the cursor in place. This is achieved by warping the cursor back to the position it was in when starting the scroll action. That by itself is not yet an issue, but when cursor warping does not "rebase" (speaking in Git version control terms) later cursor movement events already in the queue on top of the new cursor position, things get complicated. OpenTTD has to deal with that in its win32 and sdl video drivers (judging by the queued_warp parameters passed to UpdateCursorPosition - this is what tomb changed).
OpenTTD has to guess what source cursor position a mouse movement event is based on so it can calculate the difference between source and destination (because it wants to know the relative movement). To top it off, a Windows bug (see r27172) seems to randomly cause it to ignore the calls setting the cursor position.
The "fix" discovered by tomb will very likely break stuff (at least on older Windows versions) as it essentially lets OpenTTD's win32 video driver assume that all cursor movements in the queue are based on the position the cursor is locked at. It could be that Windows did actually get changed to "rebase" the cursor movements, or you just got lucky. After all, the behavior will be pretty much identical to what was present in 1.4.x which sometimes did misbehave, making the fixes in r27167 and r27172 necessary.
As a temporary fix, the cursor position locking could be disabled. That will feel very wrong though, unless you enable the setting to reverse the scroll direction. Therefore I propose to disable it only when reverse scrolling is on. I need someone who experiences the scrolling issue and can compile their own version to test that fix (maybe you, tomb?) - just open window.cpp, search for
and replace it with
Code: Select all
_cursor.fix_at = !_settings_client.gui.reverse_scroll;
and recompile. Test it with reverse scrolling on (duh). That should work just fine.
If Windows was changed to "rebase" the cursor movements, then changing tomb's fix to ask Windows if it's new enough should suffice as a better fix. However, I don't know how that would be done (my software normally isn't written for Windows), and I don't know if that's what Microsoft changed, so that could revert the situation to pre-1.5.x for users on the new Windows version.