Donnerstag, 29. August 2013

Linux dual monitor: Don't stretch fullscreen over all monitors in SDL games (psychonauts, ftl, superhexagon)

[EDIT] Some time after I wrote this, I also found this article:
http://www.maketecheasier.com/run-fullscreen-games-in-linux-with-dual-monitors/
which is a lot nicer written.

Hello everybody!

I'm using two monitors on my Linux machine: The 13" 1366x768px inbuilt one of my laptop and my 24" full hd monitor. I don't need to say, that those do not really match to display one application over both of them. Unfortunately though, many games based on the well known sdl library try to do exactly this: When in fullscreen, they only offer me resolutions like "3286x1080" after the notebook's resolution (nothing in between). When opening in windowed mode, they calculate the middle of the screen by taking both screens into consideration, thus opening between them.
All I want to do, though, is having fullscreen games opening with full hd resolution on my external monitor, and windowed games in the middle of just this monitor.

I was quite happy lately, when I discovered that wine/crossover will open all windows on the external monitor if I tell xrandr, that it is my "--primary" screen, using "xrandr --output HDMI-0 --primary". This doesn't work for native, sdl-based games of course, although it kind of fits in here, so I thought to mention it.

So, today I got my bluetooth controller and I really wanted to play psychonauts with it. It, too, featured the said issue, and this time I just didn't want to give up. After some heavy googling, I finally came up with the SDL_VIDEO_FULLSCREEN_HEAD variable mentioned HERE (archwiki ftw!), and -thank god- it worked as expected. So for you it is:
$: SDL_VIDEO_FULLSCREEN_HEAD=0 ~/.steam/root/SteamApps/common/Psychonauts/Psychonauts

I hope this helps someone out there. I wish happy gaming.
Sincerely

suluke

Related: 
A topic on a mailing list also discussing a similar solution can be found here: http://icculus.org/pipermail/psychonauts/2012-June/000000.html

2 Kommentare:

  1. That was pretty much the closest I ever got to solving the problem... Would you be so friendly as to describe the excact steps? I wish I could try it out on Awesomenauts to figure out how to do it with other applications but I don't own the game :/

    AntwortenLöschen
    Antworten
    1. So, what did you do so far and what are you trying to achieve in the end? Which game do you need to "fix", and what of the problem remains after you tried this method? Usually you would first go into your SteamApps (~/.steam/root/SteamApps/common/) folder to find the game binary. Then you know which command you need to prefix with SDL_VIDEO_FULLSCREEN_HEAD=0 (compare above after $:). For your convenience, you can modify the game's start menu entry in ~/.local/share/applications with a text editor and simply replace the "exec" line with the command you have now. Steam also allows you to set launch options so maybe it would also work by typing `env SDL_VIDEO_FULLSCREEN_HEAD=0` (with the ` around) in there, but I didn't try this.

      Löschen

Thanks for spending time on giving me feedback. I really appreciate it :)