RigsOfRods / rigs-of-rods

Main development repository for Rigs of Rods soft-body physics simulator
https://www.rigsofrods.org
GNU General Public License v3.0
1.01k stars 178 forks source link

Vehicle being grabbed after switching back to RoR from another active window #2468

Closed ghost closed 1 week ago

ghost commented 4 years ago

Steps to reproduce

  1. Set game to windowed mode, resolution smaller than your screen's native. Restart RoR.
  2. Open RoR, load any map, spawn any vehicle (North St Helens, Box 1969 Camaro Silverback)
  3. Click outside the RoR window onto another window so RoR is no longer the active window.
  4. Switch back to RoR (alt+tab or taskbar icon) and move your mouse over the car.

Expected behaviour

  1. Nothing should happen.

Actual behaviour

  1. The car gets grabbed by the "blue winch" and is pulled by your mouse - without you clicking on the car and holding the left mouse button.

System configuration

Windows 10 x64 DirectX9 RoR 4.8.0 RC5

Additional information, logs and screenshots (optional)

  1. This does not happen when using ALT+TAB to switch away from the RoR window.
  2. This does not happen when clicking back inside the RoR window. Only when alt+tab or taskbar icon is used to switch back to RoR.
  3. It seems when switching to another window, the "mouse down" click event gets captured in RoR but the "mouse up" event isn't, as it is no longer the active window. When returning to RoR, it seems to think the left mouse button is held down, and when hovering the mouse over the car, it grabs it.
  4. This may seem like a pretty unlikely thing to happen for most players, but I have sent too many cars flying not to at least post about it here.
tritonas00 commented 4 years ago

What is your Input grab mode setting?

ghost commented 4 years ago

Hi, thank you for the replies/involvement, I just tried all three settings, here are the results:

None - original setting, results described in first post

All - does not allow me to click outside the window, only alt+tab, so the issue does no longer occur, but also no more cursor acceleration in RoR for some reason

Dynamic - feels the same and same results as "None"

It's really not a big issue for myself now that I know how to get around it (alt+tab), just wanted to bring it to your guys' attention that's all

tritonas00 commented 4 years ago

Try with OpenGL renderer also please

ghost commented 4 years ago

I switched to OpenGL and checked again, with all 3 input grab modes, same results other than RoR being slower in general

tritonas00 commented 4 years ago

Thanks for testing! It seems a Windows issue though since i can't reproduce it on linux

ghost commented 4 years ago

No problem! that's interesting. I know nothing about input methods and mouse events capture or the engine RoR uses and how they differ between OS-es, so I can't say much. I wouldn't say it's a game-breaker though, just a minor annoyance. I can live with it, just glad it's somewhat documented now, for future reference.

Thank you for your time, to test it on Linux

disloyalpick commented 4 years ago

Happens to me also. Quick workaround would be to just click any area before moving your mouse over the vehicle.