From what I've gathered the game should be able to run in Wayland natively, but I cannot get it to work.
I have XDG_SESSION_TYPE set to wayland, which works for applications that use glfw. However, Vintage Story only launches in X11. When I remove the included glfw.so files, it does launch using Wayland, but crashes. I can reproduce this in both hyprland and tinywl, so it doesn't look like a compositor specific issue. Maybe the environment is not being passed to the runtime? When I try to force the game to use the discrete GPU with prime-run, it has no effect either.
How to reproduce
Environment variables
Game version: 1.19.8 or 1.20.0-pre4
OS: Linux 6.11.0-gentoo
WM: Hyprland (Wayland) + XWayland
.NET: dotnet-sdk-bin-7.0
Extract tarball and execute run.sh
The game will launch in X11 via Xwayland.
Delete glfw .so files from Lib so native libraries are used
The window is forced to use Wayland, and crashes with the errors below.
Screenshots
No response
Logs
system GLFW 3.3.9 built with wayland only
Couldn't start NamedPipeServer.
4.10.2024 21:13:15 [Client Notification] Client logger started.
4.10.2024 21:13:15 [Client Notification] Game Version: v1.19.8 (Stable)
4.10.2024 21:13:16 [Client Notification] Process path: /home/timo/games/vintagestory/Vintagestory
4.10.2024 21:13:16 [Client Notification] Operating System: Linux (Gentoo Linux) [Kernel 6.11.0.0]
4.10.2024 21:13:16 [Client Notification] CPU Cores: 12
4.10.2024 21:13:16 [Client Notification] Available RAM: 63654 MB
4.10.2024 21:13:16 [Client Debug] Creating game window with window mode Fullscreen
4.10.2024 21:13:17 [Client Fatal] Game Version: v1.19.8 (Stable)
04/10/2024 21:13:16: Critical error occurred
Loaded Mods:
OpenTK.Windowing.GraphicsLibraryFramework.GLFWException: Wayland: Focusing a window requires user interaction
at OpenTK.Windowing.Desktop.GLFWProvider.DefaultErrorCallback(ErrorCode errorCode, String description)
Crashreport failed: System.UnauthorizedAccessException: Access to the path '/tmp/VSLastCrash.txt' is denied.
---> System.IO.IOException: Permission denied
--- End of inner exception stack trace ---
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Func`4 createOpenException)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Func`4 createOpenException)
at System.IO.File.OpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
at Vintagestory.ClientNative.CrashReporter.Crash(Exception exCrash) in VintagestoryLib\Client\ClientPlatform\ClientNative\CrashReporter.cs:line 212
4.10.2024 21:13:17 [Client Notification] Exiting game now. Server running=False. Exit reason: Game crashed
Unhandled exception. OpenTK.Windowing.GraphicsLibraryFramework.GLFWException: Wayland: Focusing a window requires user interaction
at OpenTK.Windowing.Desktop.GLFWProvider.DefaultErrorCallback(ErrorCode errorCode, String description)
./run.sh: line 3: 9439 Aborted DOTNET_ROOT=/opt/dotnet-sdk-bin-7.0/ ./Vintagestory
system GLFW 3.4 X support disabled
Couldn't start NamedPipeServer.
4.10.2024 21:21:09 [Client Notification] Client logger started.
4.10.2024 21:21:09 [Client Notification] Game Version: v1.19.8 (Stable)
4.10.2024 21:21:09 [Client Notification] Process path: /home/timo/games/vintagestory/Vintagestory
4.10.2024 21:21:09 [Client Notification] Operating System: Linux (Gentoo Linux) [Kernel 6.11.0.0]
4.10.2024 21:21:09 [Client Notification] CPU Cores: 12
4.10.2024 21:21:09 [Client Notification] Available RAM: 63654 MB
4.10.2024 21:21:09 [Client Debug] Creating game window with window mode Fullscreen
4.10.2024 21:21:10 [Client Fatal] Game Version: v1.19.8 (Stable)
04/10/2024 21:21:10: Critical error occurred
Loaded Mods:
OpenTK.Windowing.GraphicsLibraryFramework.GLFWException: Wayland: The platform does not provide the window position
at OpenTK.Windowing.Desktop.GLFWProvider.DefaultErrorCallback(ErrorCode errorCode, String description)
Crashreport failed: System.UnauthorizedAccessException: Access to the path '/tmp/VSLastCrash.txt' is denied.
---> System.IO.IOException: Permission denied
--- End of inner exception stack trace ---
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Func`4 createOpenException)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Func`4 createOpenException)
at System.IO.File.OpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
at Vintagestory.ClientNative.CrashReporter.Crash(Exception exCrash) in VintagestoryLib\Client\ClientPlatform\ClientNative\CrashReporter.cs:line 212
4.10.2024 21:21:10 [Client Notification] Exiting game now. Server running=False. Exit reason: Game crashed
Unhandled exception. OpenTK.Windowing.GraphicsLibraryFramework.GLFWException: Wayland: The platform does not provide the window position
at OpenTK.Windowing.Desktop.GLFWProvider.DefaultErrorCallback(ErrorCode errorCode, String description)
./run.sh: line 3: 11827 Aborted DOTNET_ROOT=/opt/dotnet-sdk-bin-7.0/ ./Vintagestory
Game Version
v1.19.8
Platform
Linux
Modded
Vanilla
SP/MP
Singleplayer
Description
From what I've gathered the game should be able to run in Wayland natively, but I cannot get it to work. I have XDG_SESSION_TYPE set to wayland, which works for applications that use glfw. However, Vintage Story only launches in X11. When I remove the included glfw.so files, it does launch using Wayland, but crashes. I can reproduce this in both hyprland and tinywl, so it doesn't look like a compositor specific issue. Maybe the environment is not being passed to the runtime? When I try to force the game to use the discrete GPU with prime-run, it has no effect either.
How to reproduce
Environment variables Game version: 1.19.8 or 1.20.0-pre4 OS: Linux 6.11.0-gentoo WM: Hyprland (Wayland) + XWayland .NET: dotnet-sdk-bin-7.0
Screenshots
No response
Logs
system GLFW 3.3.9 built with wayland only
system GLFW 3.4 X support disabled
vendored GLFW (launches successfully in Xwayland)
https://gist.github.com/TimovVeen/bcb1396f3c21b8ec8c671ecef0ca7b11