As with all operating systems, the way a Linux game behaves on a computer is largely dependent on the design of the game, the graphics hardware and drivers the user has, and the settings one chooses. Native Linux games are typically better at supporting the computer’s default resolution without much tweaking, but the way it handles fullscreen display on a a dual-monitor system depends on the game engine employed. After about an hour of trying to configure all of your games, you might very well find yourself drowning in sea of techno-babble and configuration files. But have no fear, MakeTechEasier has come to your rescue yet again. This brief guide to various types of games you can run in Linux on a dual-monitor system is based on my experience with an Nvidia 3D graphics card and the accompanying proprietary drivers. Nevertheless, most of it will apply to all 3D graphics cards. This guide also assumes that you already have your dual-monitor setup functioning by utilizing Xinerama, TwinView, XRandR, or some other method. This does not apply to dual-monitor setups that use separate Xorg instances for each monitor.
The Problem
When running a game, either as a native Linux application or through Wine, you have probably encountered one of these situations:
- The game takes over both monitors and stretches the images over both.
- One screen goes dark, and the other screen displays the game correctly. This may be found for many users.
- The game maximizes on one screen, but it is not the screen you want to use.
The Solutions
Unfortunately, there is no one solution for all three situations, but there are a few ways to fix them, depending on your preferences. Windowed Play Although this may seem like more of a workaround, you can actually have a game run in a window and then turn that window into a fullscreen one. Follow these steps:
- Configure the game to run in a window. For many Linux games, this might involve editing the configuration file, usually found in ~/.game-name/
- Set the game’s resolution to your desktop’s exact resolution.
- Start the game.
- Use your window manager to make the window full screen (In KDE, right-click on the title bar, hover over ‘Advanced’ and click ‘Fullscreen’. You can also use a shortcut key, if configured. In some games, the ‘Fullscreen’ option will be unavailable. For these, choose ‘No Border’.) As you might have noticed, Windowed Play has its disadvantages, particularly if your window manager does not have its own fullscreen feature. The biggest advantage is that, if you are like me and are supposed to be working rather than playing games, you can still at least have a business or work app open on the other screen to offer some semblance of efficiency.
Single Full Screen On nearly all native Linux games that I have encountered, you can achieve true fullscreen results simply by configuring the game to use the resolution of one monitor. This, however, does not guarantee that it will be on the screen you want. A universal method is to use xrandr to turn off one of the monitors. For example, you can run the following command in a terminal: There are also graphical xrandr programs available, such as krandtray (Resize and Rotate) or gnome-randr-applet (Display Geometry Switcher). In either case, simply select the monitor you want to turn off and disable it, or in the case of a large virtual display (such as the kind with TwinView), select the smaller resolution. For SDL games, you can setup an environment variable that will force it to use the screen you want, and this will dim the unused screen as long as you are playing. The number indicates the display number of the monitor, so change it according to your needs. You can even plug this into the game’s startup script and make it all automatic.
Windows Games in Wine There is an easy way to use a windowed mode in Wine:
- Start Wine Configuration (winecfg)
- Click on the ‘Graphics’ tab
- Check ‘Emulate a virtual desktop’
- Next to ‘Desktop size’ enter your exact screen resolution.
When you start Wine applications, it will have a Windows desktop in the background. When starting games, the games should go fullscreen with no window border. This should prevent Windows games from stretching over both screens and give you a fullscreen experience. There are other options available for fullscreen gaming on dual monitors, and the only way to find the best method for your setup is to experiment with different techniques.