A Brief List of Ways to Make Xinerama and Games Get Along

As none of you certainly know, my system has a very odd video setup:

  • Because I hate bad window management misplacing things when the resolution changes, I’ve used xorg.conf to lock my desktop at 2560×1024
  • Because I’m using nVidia TwinView, XRandR tells applications that the entire desktop is one monitor but the window manager still gets the Xinerama hints it needs to interpret fullscreen and maximize as only half of that.
  • Games generally assume that you’ll want to play them fullscreen… sometimes not even offering an obvious way to enable windowed mode.
  • Since I got my new video card with HDMI for the second monitor, my right monitor is the first one, not my left one.

I think you can see where this might cause a problem. Games tend to exhibit one of the following behaviours:

  • Fullscreen across both displays, centered on the big physical gap between screens. (Not since my new video card)
  • Fullscreen on the right-hand monitor, center as if fullscreening across both displays. (Since my new video card)
  • Fullscreen on one monitor, letterbox to the aspect ratio of the desktop as a whole (YouTube and Cortex Command, I’m looking at you)
  • Windowed mode, but only offer 2560×1024 as a resolution unless you edit the config file manually because they naïvely use SDL’s list of fullscreen resolutions for windowed mode too.

This wouldn’t be a huge deal, since I tend to prefer windowed-mode play anyway, except that sometimes, the mouse is mapped wrong too, so you can see the “Options” button but can’t click it.

So far, here are the workarounds I’ve found successful:

  1. Just let the stupid things muck with your resolution settings (I’d rather not game instead, but you may feel differently)
  2. Manually edit the config file to set windowed mode and a sane resolution. (Most commonly successful option for open-source games. Look for ~/.gamename, ~/.config/gamename, or possibly ~/.local/share/gamename)
  3. Check -h, -help, --help, -?, and any README files for an option to start windowed. Try -w, -windowed, and --windowed just in case. (eg. Braid)
  4. Try pressing Alt+Enter at the main menu screen (eg. World of Goo)
  5. Run it inside Xephyr (Currently only supports software rendering, but there’s a fork I haven’t tried yet which passes OpenGL through to the host for hardware rendering.)
  6. Run the Windows version inside Wine with a virtual desktop. (eg. Psychonauts, Space Rangers 2. Doesn’t work with all games because, for reasons I can’t fathom, some games do double-buffering normally (which Wine supports) and triple- or quadruple-buffering (which Wine doesn’t yet support) when you try to run them in a virtual desktop)
  7. If it’s something where having a bar down the center of the monitor is a small price to pay for seeing more  (like a strategy game), use export SDL_VIDEO_FULLSCREEN_HEAD=2 to put it on your top-left monitor so it’ll try to span all of them without realizing it. (eg. Revenge of the Titans. Thanks to MakeTechEasier.com for this.)

Once you’ve got that, you may want to simulate fullscreen on a single monitor. The simplest way to do that is to set the window to the same resolution as your monitor, use “Always on Top” to make it cover your panels (taskbar, etc.), and then hide the window border to make it fit the screen. There are two ways to do that:

  1. Right-click your window titlebar while the window’s loading, set Always on Top, and then either do it again to hide the window decoration or, if that’s no an option, bind something like WinKey+T to toggle WinDeco and press it. (Tested working in KDE and LXDE/OpenBox)
  2. If your window manager allows you to set per-application rules (again, tested working with KDE and LXDE/OpenBox), you can automate this. See your window manager’s documentation for details. (I also use this to make Minecraft start maximized)

One more tip: With games like Trine and Aquaria which capture the mouse, you can toggle the grab with Ctrl+G… useful in Trine for switching back and forth between the game and a walkthrough to get those last few experience vials that you literally can’t find without being told about them.

Update: One or both of these may also help with some games. (Thanks to the Torchlight README.linux for clueing me in)


CC BY-SA 4.0 A Brief List of Ways to Make Xinerama and Games Get Along by Stephan Sokolow is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

This entry was posted in Geek Stuff. Bookmark the permalink.

1 Response to A Brief List of Ways to Make Xinerama and Games Get Along

  1. Pingback: Stephan Sokolow’s Blog » SDL and TwinView

Leave a Reply

Your email address will not be published. Required fields are marked *

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/web site in attribution under the same terms as the associated post.

All comments are moderated. If your comment is generic enough to apply to any post, it will be assumed to be spam. Borderline comments will have their URL field erased before being approved.