Ubuntu – Screen resolution remains 640×480 when I close a game


I played Lugaru, the game went in Full screen mode, but when I closed the game, the screen resolution was still 640×480. It happened with Neighbours From Hell also, using Wine, and well… Almost every game i tried in fullscreen mode. Is it normal? Is there a fix for that?

Best Answer

Fullscreen handling in Linux is rather broken and lots of games are causing such troubles. Easiest workaround is probably to use xrandr to bring things back into the proper resolution (put that in a script and make it an icon in the top/left corner of your screen for easy restore):

For a single monitor setup that would be simply something like:

xrandr --output DFP2 --mode "1680x1050"

For a multimonitor setup it would look like:

xrandr \
 --output DFP2 \
   --mode "800x600" \
   --panning "800x600+1280+0/0x0+0+0" \
 --output CRT1 \
   --mode "1280x1024" \
   --panning "1280x1024+0+0/0x0+0+0"

Running xrandr without any option give you a list of supported modes and available displays.

Note there is also a bug in xrandr itself, sometimes the monitor size will adjust, but the mouse movement will still be locked to the old resolution, to fix that just run xrandr a second time.

Alternatively you can also set wine to emulate a virtual desktop, this will prevent games from going fullscreen and force them to be confined to the Wine virtual desktop window. The setting available in winecfg and then Graphics->Emulate a virtual desktop.

Related Question