Skip to content

Commit

Permalink
Launch in a virtual desktop
Browse files Browse the repository at this point in the history
This will stop crashes when alt-tabbing and switching from fullscreen.
It will fix #2 on xorg systems. No idea about wayland. This needs
checked and worked around.
It pulls in some x utilities which may not be desirable.
  • Loading branch information
mcphail authored and flexiondotorg committed Jun 14, 2018
1 parent 3986d80 commit 1040fd4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion snap/scripts/sommelier
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ function launch_app() {
mkdir -p "${WINEPREFIX}/drive_c/users/${USER}/My Documents/TmForever/Config"
touch "${WINEPREFIX}/drive_c/users/${USER}/My Documents/TmForever/Config/GfxDevicePerfs.txt"

# Get the native resolution. Creating a virtual desktop the same size will
# eliminate bugs when switching from fullscreen to windowed mode
NATIVE_RES=$(xrandr -q | awk -F'current' -F',' 'NR==1 {gsub("( |current)","");print $2}')

# If we don't change into the program directory some assets may not be found
cd "${WINE_DIR}"
env WINEARCH="${WINEARCH}" WINEPREFIX="${WINEPREFIX}" "${WINELOADER}" "${WINE_EXE}"
env WINEARCH="${WINEARCH}" WINEPREFIX="${WINEPREFIX}" "${WINELOADER}" explorer /desktop="virtual","${NATIVE_RES}" "${WINE_EXE}"
}

function prepend_dir() {
Expand Down
1 change: 1 addition & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ parts:
- unzip:i386 # winetricks
- wget:i386 # winetricks
- yad:i386 # winetricks
- x11-xserver-utils:i386 # for xrandr to set virtual desktop
override-build: |
snapcraftctl build
rm -rf $SNAPCRAFT_PART_INSTALL/etc/init
Expand Down

0 comments on commit 1040fd4

Please sign in to comment.