Don't want to see articles from a certain category? When logged in, go to your User Settings and adjust your feed in the Content Preferences section where you can block tags!
We do often include affiliate links to earn us some pennies. See more here.

SDL 2.0.22 will default to Wayland on Linux

By -

Simple DirectMedia Layer (SDL) is one of the most important pieces of open source for Linux gamers, as it's the tech used by various game engines and games. It's also about to continue changing the game for the Linux desktop in the upcoming version.

What does it actually do? It's a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware.

It has been announced that the SDL 2.0.22 will default to Wayland, preferring it over X11. This is another big step towards Wayland properly being a replacement for the old and crusty X11 everywhere. With this we might end up seeing more games and applications be native to Wayland, rather than having to run through XWayland.

Developer Ryan C. Gordon (also known as Icculus) mentioned on Twitter: "If you or your distro has not supplied a libdecor, you absolutely want to get that in place by around March 2022". A lot of the heavy lifting involved was done by Ethan Lee (also known as flibitijibibo), who mentioned on Twitter that almost all of the work involved was funded by sponsors of their GitHub.

Article taken from GamingOnLinux.com.
31 Likes
About the author -
author picture
I am the owner of GamingOnLinux. After discovering Linux back in the days of Mandrake in 2003, I constantly checked on the progress of Linux until Ubuntu appeared on the scene and it helped me to really love it. You can reach me easily by emailing GamingOnLinux directly. You can also follow my personal adventures on Bluesky.
See more from me
The comments on this article are closed.
All posts need to follow our rules. For users logged in: please hit the Report Flag icon on any post that breaks the rules or contains illegal / harmful content. Guest readers can email us for any issues.
21 comments
Page: 1/2»
  Go to:

Zappor Jan 27, 2022
So you can use SDL 2.0.22 to run Linux native SDL games without XWayland, like Stellaris, Factorio, Jupiter Hell.
They usually ship with their own copy of SDL but you can override it with SDL_DYNAMIC_API=/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 for example.
AussieEevee Jan 27, 2022
So if you're using xorg.... you don't get this? I honestly am not sure I understand what this article is saying.
Liam Dawe Jan 27, 2022
So if you're using xorg.... you don't get this? I honestly am not sure I understand what this article is saying.
It will continue to work fine with X11 it's not dropping support, but developers using it will see Wayland as the default now.
iiigg4giy Jan 27, 2022
More Wayland is always good to hear but I get confused how these things all fit together. What's the difference between SDL and vulkan for example?
slapin Jan 27, 2022
  • Supporter Plus
That is quite stupid as they could check for wayland session, I wonder why this even needed, PR? or RedHat paid them?
slapin Jan 27, 2022
  • Supporter Plus
So you can use SDL 2.0.22 to run Linux native SDL games without XWayland, like Stellaris, Factorio, Jupiter Hell.
They usually ship with their own copy of SDL but you can override it with SDL_DYNAMIC_API=/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 for example.

That won't affect SDL1 games.
Samsai Jan 27, 2022
More Wayland is always good to hear but I get confused how these things all fit together. What's the difference between SDL and vulkan for example?
SDL is a platform abstraction library, Vulkan is a graphics (and GPGPU?) API. So the overall way these would fit together is someone starts a game that uses SDL on a Wayland based desktop, SDL realizes it is running on Wayland and makes appropriate calls to create a Wayland window and then sets up a Vulkan context for that window. Then the game can start talking Vulkan and game graphics get drawn where they should be.
Zappor Jan 27, 2022
That won't affect SDL1 games.

Right, this is SDL2 so SDL2 games only!
Zappor Jan 27, 2022
That is quite stupid as they could check for wayland session, I wonder why this even needed, PR? or RedHat paid them?

When an SDL2 game starts it tries to find a display. SDL 2.0.20 and earlier checked for an X11 display first and through the magic of XWayland they found one. And this was the desired outcome also since there were still a number of bugs in SDL's Wayland backend.

But now with basically all the (known) bugs fixed in the Wayland backend, they can check for a pure Wayland server first before checking for an X11 connection.

I.e, they changed the priority of the backends now that most SDL2-Wayland bugs are fixed.


Last edited by Zappor on 27 January 2022 at 12:29 pm UTC
BielFPs Jan 27, 2022
Awesome, I finally won't need to force Wayland through steam startup parameters anymore (but I will still need to override the game library on some cases)

Now I only need to wine/proton to mainline Wayland patches as default, then I can game without x11 on almost all of my games.

Also waiting to firefox to do the same in the main version.
orzo Jan 27, 2022
  • Supporter
A lot of the heavy lifting involved (in libdeco) was done by Ethan Lee (...) almost all of the work involved was funded by sponsors of their GitHub.
Gnome/RedHat aren't exactly supportive of native Linux gamedev, are they.
rcrit Jan 27, 2022
View PC info
  • Supporter Plus
A lot of the heavy lifting involved (in libdeco) was done by Ethan Lee (...) almost all of the work involved was funded by sponsors of their GitHub.
Gnome/RedHat aren't exactly supportive of native Linux gamedev, are they.

nit: two words, Red Hat

I'm not sure what you mean by not supportive. Red Hat employs a number of big contributors to graphics libraries and drivers like Mesa and nouveau.
F.Ultra Jan 27, 2022
View PC info
  • Supporter
A lot of the heavy lifting involved (in libdeco) was done by Ethan Lee (...) almost all of the work involved was funded by sponsors of their GitHub.
Gnome/RedHat aren't exactly supportive of native Linux gamedev, are they.

I don't think that Red Hat could care less for gaming, they make their money on servers and workstations, not on desktops for gaming.
orzo Jan 27, 2022
  • Supporter
A lot of the heavy lifting involved (in libdeco) was done by Ethan Lee (...) almost all of the work involved was funded by sponsors of their GitHub.
Gnome/RedHat aren't exactly supportive of native Linux gamedev, are they.

nit: two words, Red Hat

I'm not sure what you mean by not supportive. Red Hat employs a number of big contributors to graphics libraries and drivers like Mesa and nouveau.

That's 100% correct, Red Hat is steadily driving desktop Linux forward, but do not confuse "desktop support" for "support for gamedevs". Everybody needs drivers in top state - from browsers to edu to med to heavy industry. Not just gamers. In this case gamedev community had to spent extra effort, time and money (that could be invested elsewhere) to make native wl games run in windowed (eg debug) mode. *Someone* from linux gamedev scene (most likely Ethan Lee) will have to maintain libdeco for years to come. Constantly test it for Plasma, Gnome etc etc... It's a valid question to ask - "why was there no other way"?
Phlebiac Jan 27, 2022
That won't affect SDL1 games.

Wasn't there talk of a SDL1 -> SDL2 wrapper library? So older SDL games could also benefit from the newer library?
F.Ultra Jan 27, 2022
View PC info
  • Supporter
That won't affect SDL1 games.

Wasn't there talk of a SDL1 -> SDL2 wrapper library? So older SDL games could also benefit from the newer library?

Such a wrapper does exist:
https://github.com/MrAlert/sdlcl
Liam Dawe Jan 27, 2022
That won't affect SDL1 games.

Wasn't there talk of a SDL1 -> SDL2 wrapper library? So older SDL games could also benefit from the newer library?

Such a wrapper does exist:
https://github.com/MrAlert/sdlcl
You probably want this https://github.com/libsdl-org/sdl12-compat
Whitewolfe80 Jan 27, 2022
So if you're using xorg.... you don't get this? I honestly am not sure I understand what this article is saying.
It will continue to work fine with X11 it's not dropping support, but developers using it will see Wayland as the default now.

and thats good beacuse last time i checked xorg still curb stomped wayland in terms of gaming performance
Phlebiac Jan 28, 2022
last time i checked xorg still curb stomped wayland in terms of gaming performance

Recent benchmarks suggest otherwise:
https://www.phoronix.com/scan.php?page=article&item=kde-gnome-wayland21&num=1
TheRiddick Jan 28, 2022
Defaulting to X11 until they get full display control and management integrated in Wayland... it still not possible to execute display adjustments or ICC controls correctly like how xgamma or xrandr allowed (often made available in WM settings or GUI tools).

Wayland still has loads of little problems that all add up.. X11 does too but actually has solutions to them for the most case!


Last edited by TheRiddick on 28 January 2022 at 5:18 am UTC
While you're here, please consider supporting GamingOnLinux on:

Reward Tiers: Patreon. Plain Donations: PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
The comments on this article are closed.