SDL Wayland backend no longer working since 2022.515.0
See original GitHub issueType
Crash to desktop
Bug description
Game crashes when started with SDL_VIDEODRIVER=wayland
due to missing primary display. My compositor does not actually have a primary display, and programs (including older versions of osu) just open on whatever display my mouse is on, which is expected/fine. (Maybe fall back to the old display logic when there is no primary display?)
When started with SDL_VIDEODRIVER=x11
it opens on the display my mouse is on, but with the resolution of my other connected display, instead of the expected resolution of the display it opens on. This is repeated every time I open osu.
The game crashes with the following error when using wayland:
Unhandled exception. System.InvalidOperationException: Sequence contains no elements
at System.Linq.ThrowHelper.ThrowNoElementsException()
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at osu.Framework.Platform.SDL2DesktopWindow.get_PrimaryDisplay()
at osu.Framework.Platform.SDL2DesktopWindow.SetupWindow(FrameworkConfigManager config)
at osu.Framework.Platform.GameHost.Run(Game game)
at osu.Desktop.Program.Main(String[] args) in /var/lib/buildkite-agent/builds/debian-gnu-linux-vm-2/ppy/osu/osu.Desktop/Program.cs:line 105
Edit: Resolution also breaks whenever focus is lost on x11
Screenshots or videos
https://streamable.com/olsm6a (video is cropped on the sides due to hardware encoder limitations)
Version
2022.515.0
Logs
x11_database.log x11_legacy-ipc.log x11_network.log x11_performance.log x11_runtime.log x11_updater.log wayland_runtime.log (only runtime.log was present for wayland)
Issue Analytics
- State:
- Created a year ago
- Reactions:7
- Comments:12 (1 by maintainers)
Imo I think it’s fine bumping up the CI runner. People tend to upgrade their desktops to the latest software, if possible (which is pretty much always the case with Linux).
Related upstream thread: https://github.com/libsdl-org/SDL/pull/5429
Looks like upstream is plain giving up on wayland on older distros, which I suppose from their perspective is understandable, but is putting us in a bad spot due to an “unconventional” (in the linux world) release model. I wouldn’t be necessarily opposed to giving up on older distros ourselves, ubuntu 18.04 merely has a year of LTS left and there are two newer stable releases now, but I don’t feel it’s my call to make.