Linux mouse wheel scrolling bug fix

SC5 Server Discussion
Post Reply
GiGaBiTe
Site Admin
Posts: 49
Joined: Wed Jan 29, 2020 2:38 am

Linux mouse wheel scrolling bug fix

Post by GiGaBiTe »

In my quest to avoid the cancer that is Windows 10, my next gaming rig is going to be Linux based, but one of the teething issues was old GoldSRC games having weird glitchy behavior when using the mouse wheel scrolling in either direction. After digging into the issue for a bit over a week, I found a surprisingly simple solution. Apparently the SDL2 lib that Valve (and by extension the SC dev team) are using for Linux input support is outdated, VERY outdated by about SEVEN YEARS. This is right around the time when Valve created Steampipe and made the Half-Life engine cross-platform for both Linux and MacOS, and not much work was done after that, which explains the outdated libs. Digging in the SDL2 BugZilla, the erratic mouse behavior had apparently been logged sometime in late 2013 and 2014 and eventually fixed at some point, but Valve never updated their libs, and apparently neither did the SC devs.

So the simple fix is to go into the game folder where the game binary resides:

/.steam/steamapps/common/Half-Life/ (for HL mods or HL itself)
/.steam/steamapps/common/Sven Co-op/ (for SC5)

And delete/rename libSDL2-s.0.so.0, then create a symlink to the system's version of the file:

ln -s /usr/lib/libSDL2-2.0.so.0 libSDL2-2.0.so.0

This will make the game use the lib from the system, rather than its own local outdated copy. The only issue I see with this method is that when Steam updates the game, it may try and overwrite the symbolic link with its own broken lib. In which case, you'll have to perform this task after every update, or make a bash script to do it for you.
Post Reply