Set fixed screen resolution for application in Wine

resolutionwinex11

For example, I've application (game) that has only 640×480 resolution. Now I've 2 options: launch it in window-mode, and will has 640×480 size or enable fullscreen and will fill all screen.

What I want is to resize application without going fullscreen (e.g. to 1024×768).

As for now I've tried 2 solutions:

  1. Enable 'Emulate a virtual desktop' in winecfg. At first it will launch desktop with that resolution, but when I enable fullscreen in application it will shrink that desktop to 640×480.

  2. Start Wine in inner X-server:

    Xephyr -ac -br -noreset -screen 1024x768 :1.0 &
    ZEPHYR_PID=$!
    sleep 1
    DISPLAY=:1.0 wine game.exe
    kill $ZEPHYR_PID
    

    Same problem here, it will resize window when I enable fullscreen.

Best Answer

i ever play in fullscreen , i make my scripts for change the resolution & refresh rate of my monitor , because i use the wrong rate , in my monitor appear a floating box with a msg "Entrace not adm" . for fix that i use something like the follow

This its with "Ace Of Spades"

#!/bin/bash

# Resolution Fix
echo `xrandr --current | grep current | awk '{print $8}'` >> /tmp/width
echo `xrandr --current | grep current | awk '{print $10}'` >> /tmp/height
cat /tmp/height | sed -i 's/,//g' /tmp/height
WIDTH=$(cat /tmp/width)
HEIGHT=$(cat /tmp/height)
rm /tmp/height /tmp/height
echo "$WIDTH"x"$HEIGHT" >> /tmp/Resolution
Resolution=$(cat /tmp/Resolution)
rm /tmp/Resolution
# Resolution Fix

BINARY="$HOME/.wine/drive_c/Ace of Spades/client.exe"
$(wine "$BINARY" -"$@" "%u") &
xrandr -s 800x600 -r 77

sleep 2
BINARYPID=$(pidof $BINARY)
taskset -p 0xFFFFFFFF $BINARYPID &

while Launchers=$(pidof "client.exe")
    do   
        sleep 1
    done
    xrandr -s $Resolution -r 63
exit 0

In Resume this script its for launch Ace Of Spade , from the "mimetype" and the servers from web-browser for the protocol "aos://" that's its another type of configuration , i not explain here.

This launch the game , after the game its launched , the resolution of monitor are change to 800x600 until i close the game , when i close the game , my resolution are restored.

Related Question