beyond-all-reason / beyond-all-reason/RecoilEngine
Consider hinting SDL videodriver when Linux wayland
- Dominant language
- C++
- Stars
- 679
- Forks
- 290
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 40
Description
See [available videodrivers](https://wiki.libsdl.org/SDL2/FAQUsingSDL).
Currently SDL2 uses `x11` video driver, even when the current system executing it is on a wayland display server.
Some have reported less problems when using wayland (by setting the `SDL_VIDEODRIVER` environment variable) than allowing the `x11` video driver to use emulated xwayland.
Consider:
- Check if `SDL_VIDEODRIVER` is already set, if not proceed (we want to respect users choice).
- Fetch information on whether the current display driver is wayland (one way is to check whether `WAYLAND_DISPLAY` environment variable is set, also check were not in x11, but there might be better ones)
- Before `SDL_Init()`, pass the `wayland` [hint](https://wiki.libsdl.org/SDL2/SDL_HINT_VIDEODRIVER) using [sethint](https://wiki.libsdl.org/SDL2/SDL_SetHint)
Contributor guide
Research direction
Locate the SDL_Init() entry point and inspect the surrounding startup path before considering SDL_SetHint(). Check how SDL_VIDEODRIVER, WAYLAND_DISPLAY, and X11 environment state are handled; done means setting the wayland video-driver hint only when no explicit SDL_VIDEODRIVER choice exists and the process is running under Wayland.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, linux
- Domain
- desktop, operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100