Anyone who has ever used an SDL application on an X11-based GUI with nVidia TwinView (most Linux users with an nVidia video card and two monitors) has probably been bitten by this one once or twice… With nVidia TwinView, fullscreen SDL apps size themselves correctly, but center themselves across the entire desktop, rather than just one screen.
I haven’t had a chance to test this workaround, but it comes highly recommended and I’ll try it out as soon as I can find a chance to restart my X server.
- Find/add the TwinView MetaModes Option line in /etc/X11/xorg.conf and add an entry that has NULL as one of the values. For example, if your existing line is:
Option "MetaModes" "1024x768, 1024x768"
Then the new line would be:
Option "MetaModes" "1024x768, 1024x768; 1024x768,NULL"
- Restart your X server
- When your game appears centered across both monitors, press Ctrl+Alt+Plus (the plus key) and X will switch to a video mode where one monitor is disabled. SDL will re-center the drawing window and you’ll be good to go.
UPDATE: Over 4 years later, I’ve ended up listing alternatives to letting the game play with your resolutions.
SDL and TwinView by Stephan Sokolow is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Pingback: A Brief List of Ways to Make Xinerama and Games Get Along | Stephan Sokolow's Blog