Repository: lutris/lutris

Issue:
Lutris forgetting Wine Config Screen Resolution setting (latest version 0.5.10.1)
### Bug description

After setting the Screen Resolution to 120 DPI in Wine Configuration (winecfg), the application has larger fonts as expected.

At some point however, the prefix forgets this setting and returns back to 96 DPI. This also happens when only starting and stopping Wine Configuration.

Sometimes this happens on the second time the application (or Wine Configuration) starts; sometimes I need to quit and start the application a bunch of times. Quitting and restarting Lutris makes this quicker: the prefix will "forget" the setting earlier.

### How to Reproduce

1. Start Wine Configuration
2. Set Screen Resolution to 120 DPI
3. Click OK
4. Start an application (or Wine Configuration) for that prefix
5. Close the application
6. Restart / Close application a bunch of times
7. Close / Restart Lutris, then restart the application
8. (Basically as if you're launching Lutris and the application many times on a daily basis.)
9. Observe that at some point the Screen Resolution will be reset to 96 DPI.

### Expected behavior

1. Set the Screen Resolution to 120 DPI
2. Expect it to stay at that setting until changed

### Log output

```shell
marcel@workstation:~$ lutris -d
INFO     2022-04-20 01:19:08,181 [startup.init_lutris:173]:Starting Lutris 0.5.10
DEBUG    2022-04-20 01:19:08,217 [xrandr._get_vidmodes:15]:Retrieving video modes from XrandR
INFO     2022-04-20 01:19:08,243 [startup.check_driver:57]:Using NVIDIA drivers 460.91.03 for x86_64
INFO     2022-04-20 01:19:08,243 [startup.check_driver:61]:GPU: GeForce GTX 1070
INFO     2022-04-20 01:19:08,243 [startup.check_driver:77]:GPU: 10DE:1B81 1462:3302 (nvidia drivers)
INFO     2022-04-20 01:19:08,292 [startup.update_runtime:213]:Startup complete
DEBUG    2022-04-20 01:19:08,380 [lutriswindow.update_store:437]:Showing 14 games
DEBUG    2022-04-20 01:19:13,244 [wine.winecfg:367]:winecfg: /home/marcel/.local/share/lutris/runners/wine/lutris-7.2-x86_64/bin/winecfg
DEBUG    2022-04-20 01:19:13,249 [wine.use_lutris_runtime:115]:/home/marcel/.local/share/lutris/runners/wine/lutris-7.2-x86_64/bin/winecfg is provided by Lutris, using runtime
ERROR    2022-04-20 01:19:13,761 [wine.game_exe:521]:The game doesn't have an executable
DEBUG    2022-04-20 01:19:13,761 [command.start:141]:__GL_SHADER_DISK_CACHE="1"
DEBUG    2022-04-20 01:19:13,761 [command.start:141]:__GL_SHADER_DISK_CACHE_PATH="/home/marcel/WinPrograms/Fritz 11/drive_c/Program Files (x86)/ChessBase/ChessProgram11"
DEBUG    2022-04-20 01:19:13,761 [command.start:141]:VK_ICD_FILENAMES="/usr/share/vulkan/icd.d/nvidia_icd.json"
DEBUG    2022-04-20 01:19:13,761 [command.start:141]:LD_LIBRARY_PATH="/home/marcel/.local/share/lutris/runners/wine/lutris-7.2-x86_64/lib:/home/marcel/.local/share/lutris/runners/wine/lutris-7.2-x86_64/lib64:/lib/x86_64-linux-gnu:/lib/i386-linux-gnu:/lib32:/lib:/lib/i386-linux-gnu/i686/sse2:/lib/i386-linux-gnu/sse2:/usr/lib/x86_64-linux-gnu/libfakeroot:/lib64:/lib64:/usr/lib:/usr/lib64:/usr/lib32:/usr/lib64:/usr/lib/i386-linux-gnu:/usr/lib/x86_64-linux-gnu:/home/marcel/.local/share/lutris/runtime/Ubuntu-18.04-i686:/home/marcel/.local/share/lutris/runtime/steam/i386/lib/i386-linux-gnu:/home/marcel/.local/share/lutris/runtime/steam/i386/lib:/home/marcel/.local/share/lutris/runtime/steam/i386/usr/lib/i386-linux-gnu:/home/marcel/.local/share/lutris/runtime/steam/i386/usr/lib:/home/marcel/.local/share/lutris/runtime/Ubuntu-18.04-x86_64:/home/marcel/.local/share/lutris/runtime/steam/amd64/lib/x86_64-linux-gnu:/home/marcel/.local/share/lutris/runtime/steam/amd64/lib:/home/marcel/.local/share/lutris/runtime/steam/amd64/usr/lib/x86_64-linux-gnu:/home/marcel/.local/share/lutris/runtime/steam/amd64/usr/lib"
DEBUG    2022-04-20 01:19:13,761 [command.start:141]:WINEDEBUG="-all"
DEBUG    2022-04-20 01:19:13,761 [command.start:141]:DXVK_LOG_LEVEL="none"
DEBUG    2022-04-20 01:19:13,761 [command.start:141]:WINEARCH="win64"
DEBUG    2022-04-20 01:19:13,761 [command.start:141]:WINE="/home/marcel/.local/share/lutris/runners/wine/lutris-7.2-x86_64/bin/wine"
DEBUG    2022-04-20 01:19:13,761 [command.start:141]:WINE_MONO_CACHE_DIR="/home/marcel/.local/share/lutris/runners/wine/lutris-7.2-x86_64/mono"
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:WINE_GECKO_CACHE_DIR="/home/marcel/.local/share/lutris/runners/wine/lutris-7.2-x86_64/gecko"
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:GST_PLUGIN_SYSTEM_PATH_1_0="/home/marcel/.local/share/lutris/runners/wine/lutris-7.2-x86_64/lib64/gstreamer-1.0/:/home/marcel/.local/share/lutris/runners/wine/lutris-7.2-x86_64/lib/gstreamer-1.0/"
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:WINEPREFIX="/home/marcel/WinPrograms/Fritz 11"
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:WINEESYNC="1"
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:WINEFSYNC="0"
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:WINE_FULLSCREEN_FSR="1"
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:DXVK_NVAPIHACK="0"
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:DXVK_ENABLE_NVAPI="1"
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:PROTON_BATTLEYE_RUNTIME="/home/marcel/.local/share/lutris/runtime/battleye_runtime"
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:PROTON_EAC_RUNTIME="/home/marcel/.local/share/lutris/runtime/eac_runtime"
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:WINEDLLOVERRIDES="d3d10core,d3d11,d3d12,d3d9,d3dcompiler_33,d3dcompiler_34,d3dcompiler_35,d3dcompiler_36,d3dcompiler_37,d3dcompiler_38,d3dcompiler_39,d3dcompiler_40,d3dcompiler_41,d3dcompiler_42,d3dcompiler_43,d3dcompiler_46,d3dcompiler_47,d3dx10,d3dx10_33,d3dx10_34,d3dx10_35,d3dx10_36,d3dx10_37,d3dx10_38,d3dx10_39,d3dx10_40,d3dx10_41,d3dx10_42,d3dx10_43,d3dx11_42,d3dx11_43,d3dx9_24,d3dx9_25,d3dx9_26,d3dx9_27,d3dx9_28,d3dx9_29,d3dx9_30,d3dx9_31,d3dx9_32,d3dx9_33,d3dx9_34,d3dx9_35,d3dx9_36,d3dx9_37,d3dx9_38,d3dx9_39,d3dx9_40,d3dx9_41,d3dx9_42,d3dx9_43,dxgi,nvapi,nvapi64,nvml=n;winemenubuilder="
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:SHELL="/bin/bash"
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:SESSION_MANAGER="local/workstation:@/tmp/.ICE-unix/1236,unix/workstation:/tmp/.ICE-unix/1236"
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:WINDOWID="67108871"
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:QT_ACCESSIBILITY="1"
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:KDED_STARTED_BY_KDEINIT="1"
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:QT_SCREEN_SCALE_FACTORS="DVI-D-0=1.125;HDMI-0=1.125;DP-0=1.125;DP-1=1.125;DP-2=1.125;DP-3=1.125;DP-4=1.125;DP-5=1.125;"
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:COLORTERM="truecolor"
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:XDG_SESSION_PATH="/org/freedesktop/DisplayManager/Session1"
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:LANGUAGE=""
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:SSH_AUTH_SOCK="/tmp/ssh-aMCjSDQVAQvI/agent.1060"
DEBUG    2022-04-20 01:19:13,762 [command.start:141]:SHELL_SESSION_ID="cd97b97541734261a25fad20715741ff"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:DESKTOP_SESSION="plasma"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:SSH_AGENT_PID="1105"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:GTK_RC_FILES="/etc/gtk/gtkrc:/home/marcel/.gtkrc:/home/marcel/.config/gtkrc"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:XCURSOR_SIZE="24"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:XDG_SEAT="seat0"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:PWD="/home/marcel"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:XDG_SESSION_DESKTOP="KDE"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:LOGNAME="marcel"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:XDG_SESSION_TYPE="x11"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:GPG_AGENT_INFO="/run/user/1000/gnupg/S.gpg-agent:0:1"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:XAUTHORITY="/home/marcel/.Xauthority"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:GTK2_RC_FILES="/etc/gtk-2.0/gtkrc:/home/marcel/.gtkrc-2.0:/home/marcel/.config/gtkrc-2.0"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:HOME="/home/marcel"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:LANG="nl_NL.UTF-8"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:XDG_CURRENT_DESKTOP="KDE"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:KONSOLE_DBUS_SERVICE=":1.489"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:KONSOLE_DBUS_SESSION="/Sessions/1"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:PROFILEHOME=""
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:XDG_SEAT_PATH="/org/freedesktop/DisplayManager/Seat0"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:KONSOLE_VERSION="201203"
DEBUG    2022-04-20 01:19:13,763 [command.start:141]:KDE_SESSION_UID="1000"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:XDG_SESSION_CLASS="user"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:TERM="xterm-256color"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:USER="marcel"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:COLORFGBG="15;0"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:LC_RESPONSE="en_US.UTF-8"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:KDE_SESSION_VERSION="5"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:PAM_KWALLET5_LOGIN="/run/user/1000/kwallet5.socket"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:DISPLAY=":0"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:SHLVL="1"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:LC_MESSAGES="en_US.UTF-8"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:XDG_VTNR="7"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:XDG_SESSION_ID="3"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:XDG_RUNTIME_DIR="/run/user/1000"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:QT_AUTO_SCREEN_SCALE_FACTOR="0"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:XCURSOR_THEME="breeze_cursors"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:XDG_DATA_DIRS="/home/marcel/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:KDE_FULL_SESSION="true"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:PATH="/home/marcel/Bin:/home/marcel/.cargo/bin:/usr/local/go/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:KDE_APPLICATIONS_AS_SCOPE="1"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:KONSOLE_DBUS_WINDOW="/Windows/1"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:_="/usr/games/lutris"
DEBUG    2022-04-20 01:19:13,764 [command.start:141]:PYTHONPATH="/usr/lib/lutris:/usr/games:/usr/lib/python39.zip:/usr/lib/python3.9:/usr/lib/python3.9/lib-dynload:/usr/local/lib/python3.9/dist-packages:/usr/lib/python3/dist-packages"
DEBUG    2022-04-20 01:19:13,765 [command.start:141]:LUTRIS_GAME_UUID="160895e2-20cf-4716-b9fa-5984d1b73308"
Started initial process 86586 from /home/marcel/.local/share/lutris/runners/wine/lutris-7.2-x86_64/bin/winecfg
Start monitoring process.
esync: up and running.
Initial process has exited (return code: 0)
Monitored process exited.
Exit with return code 0
DEBUG    2022-04-20 01:19:23,694 [command.on_stop:195]:Process 86584 has terminated with code 0
DEBUG    2022-04-20 01:19:25,646 [wine.winecfg:367]:winecfg: /home/marcel/.local/share/lutris/runners/wine/lutris-7.2-x86_64/bin/winecfg
DEBUG    2022-04-20 01:19:25,650 [wine.use_lutris_runtime:115]:/home/marcel/.local/share/lutris/runners/wine/lutris-7.2-x86_64/bin/winecfg is provided by Lutris, using runtime
ERROR    2022-04-20 01:19:26,156 [wine.game_exe:521]:The game doesn't have an executable
DEBUG    2022-04-20 01:19:26,156 [command.start:141]:__GL_SHADER_DISK_CACHE="1"
DEBUG    2022-04-20 01:19:26,156 [command.start:141]:__GL_SHADER_DISK_CACHE_PATH="/home/marcel/WinPrograms/Fritz 11/drive_c/Program Files (x86)/ChessBase/ChessProgram11"
DEBUG    2022-04-20 01:19:26,156 [command.start:141]:VK_ICD_FILENAMES="/usr/share/vulkan/icd.d/nvidia_icd.json"
DEBUG    2022-04-20 01:19:26,156 [command.start:141]:LD_LIBRARY_PATH="/home/marcel/.local/share/lutris/runners/wine/lutris-7.2-x86_64/lib:/home/marcel/.local/share/lutris/runners/wine/lutris-7.2-x86_64/lib64:/lib/x86_64-linux-gnu:/lib/i386-linux-gnu:/lib32:/lib:/lib/i386-linux-gnu/i686/sse2:/lib/i386-linux-gnu/sse2:/usr/lib/x86_64-linux-gnu/libfakeroot:/lib64:/lib64:/usr/lib:/usr/lib64:/usr/lib32:/usr/lib64:/usr/lib/i386-linux-gnu:/usr/lib/x86_64-linux-gnu:/home/marcel/.local/share/lutris/runtime/Ubuntu-18.04-i686:/home/marcel/.local/share/lutris/runtime/steam/i386/lib/i386-linux-gnu:/home/marcel/.local/share/lutris/runtime/steam/i386/lib:/home/marcel/.local/share/lutris/runtime/steam/i386/usr/lib/i386-linux-gnu:/home/marcel/.local/share/lutris/runtime/steam/i386/usr/lib:/home/marcel/.local/share/lutris/runtime/Ubuntu-18.04-x86_64:/home/marcel/.local/share/lutris/runtime/steam/amd64/lib/x86_64-linux-gnu:/home/marcel/.local/share/lutris/runtime/steam/amd64/lib:/home/marcel/.local/share/lutris/runtime/steam/amd64/usr/lib/x86_64-linux-gnu:/home/marcel/.local/share/lutris/runtime/steam/amd64/usr/lib"
DEBUG    2022-04-20 01:19:26,156 [command.start:141]:WINEDEBUG="-all"
DEBUG    2022-04-20 01:19:26,156 [command.start:141]:DXVK_LOG_LEVEL="none"
DEBUG    2022-04-20 01:19:26,156 [command.start:141]:WINEARCH="win64"
DEBUG    2022-04-20 01:19:26,156 [command.start:141]:WINE="/home/marcel/.local/share/lutris/runners/wine/lutris-7.2-x86_64/bin/wine"
DEBUG    2022-04-20 01:19:26,156 [command.start:141]:WINE_MONO_CACHE_DIR="/home/marcel/.local/share/lutris/runners/wine/lutris-7.2-x86_64/mono"
DEBUG    2022-04-20 01:19:26,156 [command.start:141]:WINE_GECKO_CACHE_DIR="/home/marcel/.local/share/lutris/runners/wine/lutris-7.2-x86_64/gecko"
DEBUG    2022-04-20 01:19:26,156 [command.start:141]:GST_PLUGIN_SYSTEM_PATH_1_0="/home/marcel/.local/share/lutris/runners/wine/lutris-7.2-x86_64/lib64/gstreamer-1.0/:/home/marcel/.local/share/lutris/runners/wine/lutris-7.2-x86_64/lib/gstreamer-1.0/"
DEBUG    2022-04-20 01:19:26,156 [command.start:141]:WINEPREFIX="/home/marcel/WinPrograms/Fritz 11"
DEBUG    2022-04-20 01:19:26,156 [command.start:141]:WINEESYNC="1"
DEBUG    2022-04-20 01:19:26,156 [command.start:141]:WINEFSYNC="0"
DEBUG    2022-04-20 01:19:26,156 [command.start:141]:WINE_FULLSCREEN_FSR="1"
DEBUG    2022-04-20 01:19:26,156 [command.start:141]:DXVK_NVAPIHACK="0"
DEBUG    2022-04-20 01:19:26,156 [command.start:141]:DXVK_ENABLE_NVAPI="1"
DEBUG    2022-04-20 01:19:26,156 [command.start:141]:PROTON_BATTLEYE_RUNTIME="/home/marcel/.local/share/lutris/runtime/battleye_runtime"
DEBUG    2022-04-20 01:19:26,156 [command.start:141]:PROTON_EAC_RUNTIME="/home/marcel/.local/share/lutris/runtime/eac_runtime"
DEBUG    2022-04-20 01:19:26,156 [command.start:141]:WINEDLLOVERRIDES="d3d10core,d3d11,d3d12,d3d9,d3dcompiler_33,d3dcompiler_34,d3dcompiler_35,d3dcompiler_36,d3dcompiler_37,d3dcompiler_38,d3dcompiler_39,d3dcompiler_40,d3dcompiler_41,d3dcompiler_42,d3dcompiler_43,d3dcompiler_46,d3dcompiler_47,d3dx10,d3dx10_33,d3dx10_34,d3dx10_35,d3dx10_36,d3dx10_37,d3dx10_38,d3dx10_39,d3dx10_40,d3dx10_41,d3dx10_42,d3dx10_43,d3dx11_42,d3dx11_43,d3dx9_24,d3dx9_25,d3dx9_26,d3dx9_27,d3dx9_28,d3dx9_29,d3dx9_30,d3dx9_31,d3dx9_32,d3dx9_33,d3dx9_34,d3dx9_35,d3dx9_36,d3dx9_37,d3dx9_38,d3dx9_39,d3dx9_40,d3dx9_41,d3dx9_42,d3dx9_43,dxgi,nvapi,nvapi64,nvml=n;winemenubuilder="
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:SHELL="/bin/bash"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:SESSION_MANAGER="local/workstation:@/tmp/.ICE-unix/1236,unix/workstation:/tmp/.ICE-unix/1236"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:WINDOWID="67108871"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:QT_ACCESSIBILITY="1"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:KDED_STARTED_BY_KDEINIT="1"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:QT_SCREEN_SCALE_FACTORS="DVI-D-0=1.125;HDMI-0=1.125;DP-0=1.125;DP-1=1.125;DP-2=1.125;DP-3=1.125;DP-4=1.125;DP-5=1.125;"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:COLORTERM="truecolor"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:XDG_SESSION_PATH="/org/freedesktop/DisplayManager/Session1"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:LANGUAGE=""
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:SSH_AUTH_SOCK="/tmp/ssh-aMCjSDQVAQvI/agent.1060"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:SHELL_SESSION_ID="cd97b97541734261a25fad20715741ff"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:DESKTOP_SESSION="plasma"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:SSH_AGENT_PID="1105"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:GTK_RC_FILES="/etc/gtk/gtkrc:/home/marcel/.gtkrc:/home/marcel/.config/gtkrc"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:XCURSOR_SIZE="24"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:XDG_SEAT="seat0"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:PWD="/home/marcel"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:XDG_SESSION_DESKTOP="KDE"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:LOGNAME="marcel"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:XDG_SESSION_TYPE="x11"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:GPG_AGENT_INFO="/run/user/1000/gnupg/S.gpg-agent:0:1"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:XAUTHORITY="/home/marcel/.Xauthority"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:GTK2_RC_FILES="/etc/gtk-2.0/gtkrc:/home/marcel/.gtkrc-2.0:/home/marcel/.config/gtkrc-2.0"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:HOME="/home/marcel"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:LANG="nl_NL.UTF-8"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:XDG_CURRENT_DESKTOP="KDE"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:KONSOLE_DBUS_SERVICE=":1.489"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:KONSOLE_DBUS_SESSION="/Sessions/1"
DEBUG    2022-04-20 01:19:26,157 [command.start:141]:PROFILEHOME=""
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:XDG_SEAT_PATH="/org/freedesktop/DisplayManager/Seat0"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:KONSOLE_VERSION="201203"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:KDE_SESSION_UID="1000"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:XDG_SESSION_CLASS="user"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:TERM="xterm-256color"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:USER="marcel"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:COLORFGBG="15;0"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:LC_RESPONSE="en_US.UTF-8"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:KDE_SESSION_VERSION="5"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:PAM_KWALLET5_LOGIN="/run/user/1000/kwallet5.socket"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:DISPLAY=":0"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:SHLVL="1"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:LC_MESSAGES="en_US.UTF-8"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:XDG_VTNR="7"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:XDG_SESSION_ID="3"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:XDG_RUNTIME_DIR="/run/user/1000"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:QT_AUTO_SCREEN_SCALE_FACTOR="0"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:XCURSOR_THEME="breeze_cursors"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:XDG_DATA_DIRS="/home/marcel/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:KDE_FULL_SESSION="true"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:PATH="/home/marcel/Bin:/home/marcel/.cargo/bin:/usr/local/go/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:KDE_APPLICATIONS_AS_SCOPE="1"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:KONSOLE_DBUS_WINDOW="/Windows/1"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:_="/usr/games/lutris"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:PYTHONPATH="/usr/lib/lutris:/usr/games:/usr/lib/python39.zip:/usr/lib/python3.9:/usr/lib/python3.9/lib-dynload:/usr/local/lib/python3.9/dist-packages:/usr/lib/python3/dist-packages"
DEBUG    2022-04-20 01:19:26,158 [command.start:141]:LUTRIS_GAME_UUID="5ceea42c-11fe-4a3e-ae9b-5acb0ea536b5"
Started initial process 86659 from /home/marcel/.local/share/lutris/runners/wine/lutris-7.2-x86_64/bin/winecfg
Start monitoring process.
esync: up and running.
Initial process has exited (return code: 0)
Monitored process exited.
Exit with return code 0
DEBUG    2022-04-20 01:19:34,885 [command.on_stop:195]:Process 86657 has terminated with code 0
INFO     2022-04-20 01:19:36,025 [application.do_shutdown:885]:Shutting down Lutris
marcel@workstation:~$
```


### System Information

```shell
[System]
OS:              Debian GNU/Linux 11 bullseye
Arch:            x86_64
Kernel:          5.10.0-13-amd64
Desktop:         KDE
Display Server:  x11

[CPU]
Vendor:          GenuineIntel
Model:           Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
Physical cores:  4
Logical cores:   8

[Memory]
RAM:             31.3 GB
Swap:            1.0 GB

[Graphics]
Vendor:          NVIDIA Corporation
OpenGL Renderer: GeForce GTX 1070/PCIe/SSE2
OpenGL Version:  4.6.0 NVIDIA 460.91.03
OpenGL Core:     4.6.0 NVIDIA 460.91.03
OpenGL ES:       OpenGL ES 3.2 NVIDIA 460.91.03
Vulkan:          Supported
```


### Media (optional)

_No response_

### Checklist:

- [X] I'm not asking for support with a game or the wine runner.
- [X] I have followed the above mentioned guides and have all the graphics and wine dependencies installed.
- [X] I have checked for existing issues that describe my problem prior to opening this one.
- [X] I understand that improperly formatted bug reports may be closed without explanation.


Discussion:
That is very curious. Is it reverting "Enable DPI Scaling" or "DPI" or both? Is the new setting explicitly "96"? Are the little "revert"  buttons still present on the right side of the settings?

Actually, could you provide a screenshots of these settings in the game configuration after the bug has struck?
Thanks for replying. It is not a game or application setting. It is this setting, in Wine Configuration:

[Image](https://i.ibb.co/P1D9V9y/screen-res.png)

(Select a prefix / application, click the Wine button on the bottom of the Lutris screen and click "Wine Configuration.)

I move the slider one setting to the right so the DPI becomes 120, then click OK (or sometimes, Apply and then OK). Initially this works and the application has larger fonts (without this, many applications have really tiny fonts), but at some point, the slider and DPI will revert back to 96. If I keep Lutris open and start / quit the appliction, it takes longer to revert; when I start the application from KDE's Kickoff, or close Lutris between launches, it reverts much more quickly.

To trigger this problem I don't even have to start an application; I can also trigger it by starting / quitting Wine Configuration.

This happens in all prefixes I've tested; but they were all prefixes that already existed in Lutris 0.5.8.3 (from the Debian Stable 11 reposotiry). I could test if this bug goes away if I create a completely new prefix, but because I have 14 games and applications installed and configured (that basically worked perfectly in 0.5.8.3) it would be a massive amount of work to re-install all of them.

In 0.5.10.1 there's a line in the release notes that says this: "Default to a base resolution when Lutris is unable to read the current configuration." I would not be surprised if this change is not working correctly and thus breaks the Screen Resolution / DPI-setting in Wine Configuration.

Lutris 0.5.8.3 (from the Debian Stable 11 repository) does not have this problem. (But that version has its own bugs in the GUI itself; unrelated to this report.)


Nope, that's a different setting. The DPI and the resolution are not the same thing. You can blame me for this one; I implemented this (mis)behaviour.

Right now, Lutris just always overwrites the setting you are using with its own version. So, to make this work, you should set it in the game configuration rather than inside the WINE settings.

Lutris overwrites the setting even if "Enable DPI Scaling" is turned off (as it is by default). It just sets it to 96 dpi on each startup.

The alternative I through of here is that if "Enable DPI Scaling" is not set, it should not touch the DPI setting in WINE, allowing the WINE settings to work normally. But then, if you had used Lutris's DPI settings, then turned them off, they actually would remain in effect. That seems very counter-intuitive to me.

I had wanted to somehow remove the DPI setting from WINE when turned off, but I did not see how to do that.
>Nope, that's a different setting. The DPI and the resolution are not the same thing. You can blame me for this one; I implemented this (mis)behaviour.

I know that Screen Resolution and DPI are not the same thing, but that setting is the one I have been using since... forever... and since the upgrade, it seemed to be broken because it reverts.

>Right now, Lutris just always overwrites the setting you are using with its own version. So, to make this work, you should set it in the game configuration rather than inside the WINE settings. Lutris overwrites the setting even if "Enable DPI Scaling" is turned off (as it is by default). It just sets it to 96 dpi on each startup.

That explains it. I found the setting "DPI Scaling" in Right-Click -> Configure -> Runner Options and set it to 120. It seems to work.

>The alternative I through of here is that if "Enable DPI Scaling" is not set, it should not touch the DPI setting in WINE, allowing the WINE settings to work normally. But then, if you had used Lutris's DPI settings, then turned them off, they actually would remain in effect. That seems very counter-intuitive to me. I had wanted to somehow remove the DPI setting from WINE when turned off, but I did not see how to do that.

Well... having this setting revert without a clear explanation (where it didn't do so before) makes it look like a bug, despite it being implemented to behave like that. My suggestion would be to add a note to the DPI Scaling setting in game/app config stating that if you enable this, it will revert the Wine Configuration setting to the default and use the DPI Scaling setting instead. Then, don't the Wine configuration setting as long as DPI Scaling in the game/app runner options is not enabled.

Resolving patch:
diff --git a/lutris/runners/wine.py b/lutris/runners/wine.py
--- a/lutris/runners/wine.py
+++ b/lutris/runners/wine.py
@@ -376,8 +376,7 @@ def dxvk_vulkan_callback(widget, option, config):
                 "default": False,
                 "help": _(
                     "Enables the Windows application's DPI scaling.\n"
-                    "Otherwise, disables DPI scaling by using 96 DPI.\n"
-                    "This corresponds to Wine's Screen Resolution option."
+                    "Otherwise, the Screen Resolution option in 'Wine configuration' controls this."
                 ),
             },
             {
@@ -766,8 +765,8 @@ def set_regedit_keys(self):
         prefix_manager.set_dpi(self.get_dpi())
 
     def get_dpi(self):
-        """Return the DPI to be used by Wine; returns 96 to disable scaling,
-        as this is Window's unscaled default DPI."""
+        """Return the DPI to be used by Wine; returns None to allow Wine's own
+        setting to govern."""
         if bool(self.runner_config.get("Dpi")):
             explicit_dpi = self.runner_config.get("ExplicitDpi")
             if explicit_dpi == "auto":
@@ -778,7 +777,7 @@ def get_dpi(self):
                 explicit_dpi = None
             return explicit_dpi or get_default_dpi()
 
-        return 96
+        return None
 
     def setup_dlls(self, manager_class, enable, version):
         """Enable or disable DLLs"""
diff --git a/lutris/util/wine/prefix.py b/lutris/util/wine/prefix.py
--- a/lutris/util/wine/prefix.py
+++ b/lutris/util/wine/prefix.py
@@ -235,9 +235,40 @@ def set_desktop_size(self, desktop_size):
             self.set_registry_key(path, "WineDesktop", desktop_size)
 
     def set_dpi(self, dpi):
-        """Sets the DPI for WINE to use. 96 DPI is effectively unscaled."""
-        self.set_registry_key(self.hkcu_prefix + "/Software/Wine/Fonts", "LogPixels", dpi)
-        self.set_registry_key(self.hkcu_prefix + "/Control Panel/Desktop", "LogPixels", dpi)
+        """Sets the DPI for WINE to use. None remove the Lutris setting,
+        to leave WINE in control."""
+
+        assignment_path = os.path.join(self.path, ".lutris_dpi_assignment")
+        key_paths = [self.hkcu_prefix + "/Software/Wine/Fonts",
+                     self.hkcu_prefix + "/Control Panel/Desktop"]
+
+        def assign_dpi(dpi):
+            for key_path in key_paths:
+                self.set_registry_key(key_path, "LogPixels", dpi)
+
+        def is_lutris_dpi_assigned():
+            """Check if Lutris assigned the DPI presently found in the registry."""
+            try:
+                with open(assignment_path, "r", encoding='utf-8') as f:
+                    assigned_dpi = int(f.read())
+            except Exception as ex:
+                logger.exception("Unable to read lutris assigned DPI: %s", ex)
+                return False
+
+            for key_path in key_paths:
+                if assigned_dpi != self.get_registry_key(key_path, "LogPixels"):
+                    return False
+            return True
+
+        if dpi:
+            assign_dpi(dpi)
+
+            with open(assignment_path, "w", encoding='utf-8') as f:
+                f.write(str(dpi))
+        elif os.path.isfile(assignment_path):
+            if is_lutris_dpi_assigned():
+                assign_dpi(96)  # reset previous DPI
+            os.remove(assignment_path)
 
     def configure_joypads(self):
         """Disables some joypad devices"""


Test patch: