Why screen resolution remains 640x480 when I close a game?

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.


This happens to me sometimes when exiting a game. It seems random. I am not sure if it's a problem with Wine or the original game code (probably both).

For me, the command to go back to my native resolution was:

xrandr --output HDMI-0 --preferred