Saturday, July 19, 2014

Workaround for Linux+Wine to fix games screen that is too big for display

If you've set your game(World of Warcraft for me) to run at a lower resolution than your current  desktop resolution in Linux, you may find that there will be a viewport showing part of the game and you have to pan around with your mouse.

It's a little ... annoying.

It happens to both my ATI card and Nvidia card running proprietary drivers.

This hasn't always happened. Version 1.0 of Wine for example doesn't exhibit this behaviour.


The workaround is a little clunky; before running the game, use xrandr  to check the available modes and then use xrandr to set the game resolution

e.g. launching a terminal and running xrandr:

chocobo:~$ xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 16384 x 16384
DVI-I-0 disconnected (normal left inverted right x axis y axis)
VGA-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm
   1920x1080      60.0*+
   1680x1050      60.0  
   1280x1024      75.0     60.0  
   1152x864       75.0  
   1024x768       75.0     60.0  
   800x600        75.0     60.3  
   640x480        75.0     59.9  
HDMI-0 disconnected (normal left inverted right x axis y axis)

It shows DVI-I-1 connected on my setup, so if my game runs at 1024X768, I'll run the command

xrandr  --output DVI-I-1  --mode 1024x768 


The desktop will resize to this resolution.

Start your Wine game. It should fit the viewport on your monitor.

Once you exit, set the resolution back to the default desktop setting:

 xrandr  --output DVI-I-1  --mode 1920x1080




No comments: