The current “x86_64 – Chromium + 64-bit binaries” branch of Garry’s Mod doesn’t manage multiple monitors correctly. Это known issue, however it is not known when it will be offically resolved. This temporary fix disables and re-enables your non-primary monitors when launching the game as a work around for the issue.
Temporary fix
There are two components to this work around, creating a bash script to disable and reenable our monitors and patching this script into running when we launch Garry’s Mod.
Первый, we will create our bash script. You can find an example script I made for myself, здесь.
Create a new bash script in a text editor of choice.
We want to disable every monitor besides the one Garry’s Mod will run on, we can find out which monitors we have by running the following command in a terminal widnow.
Take note of the name of every connected display which is not your primary display. В моем случае, I have one extra display connected by DisplayPort called DP-0. For every non-primary display, we want to add the following line to the bash script, replacing %displayname% with its name.
We then need to wait for the game to launch before re-enabling these displays. I am a novice at scripting, so adding a sleep command to the script for about the time it takes for the game to launch is fine. If your game takes an exceptionally long time to start loading you may have to increase this value.
Then we want to re-enable the other displays. For every non-primary display, we want to add the following line to the bash script, replacing %displayname% with its name. We also want to give some arguments on how to position this display, play around with the -right-of, –left-of, –ниже, и –выше commands to your liking.
Save the script and move it to your GarrysMod folder. You can quickly get there by right clicking on Garry’s Mod in your library and clicking on Управлять, затем Просмотр локальных файлов.
You will need to make your script executable, either do this through your file manager or by opening a terminal and running the following, replacing %scriptname% with the script name.
Finally we need to “пластырь” the execution of the game so it runs this script when we launch Garry’s Mod. The easiest way I’ve found to do this is by editing the hl2.sh launch script in the GarrysMod folder. You can find an example script I made for myself, здесь[gist.github.com].
This script prepares your operating system to launch the Garry’s Mod executable when you press play in Steam, changing it should not effect your executable in anyway and all changes can be reverted by verifying your game files.
Открыть hl2.sh in a text editor of your choice and add the following line near the top. This line will run the script you previously created when you launch Garry’s Mod.
Now when you launch Garry’s Mod, your secondary displays should turn off the game should launch and your secondary displays will turn back on after a delay. Важно, the game should auto-detect only your primary monitor, avoiding the multiple monitor issue.
Это все, чем мы делимся сегодня для этого. Гаррис Мод гид. Это руководство было первоначально создано и написано Lamarr. На случай, если нам не удастся обновить это руководство, вы можете найти последнее обновление, следуя этому связь.