With today’s SDL2 Git, Wayland is now preferred over X.Org/X11 by default without having to set the SDL video driver environment variable.
As of today’s Git development code for the Simple DirectMedia Layer and what will be the behavior in the upcoming SDL 2.0.22, Wayland is now preferred when present. While SDL2 has offered Wayland support for some time now, SDL2 would out-of-the-box prefer X11 (and XWayland in turn) support. The SDL_VIDEODRIVER=wayland environment variable can be used for forcing the Wayland code path while now it’s the preferred route.
Wayland support has matured rather well in recent years… It’s been a long journey, but things are coming together. Far better than the early days as pictured.
This change by developer Ethan Lee puts Wayland ahead of X11 now for the SDL video code. This is good news for ultimately getting more Linux games running on native Wayland where applicable rather than through XWayland, at least for games not having other interconnected dependencies on X11.