-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDL2 should default to "wayland" video driver #11748
Comments
SDL 3 defaults to Wayland as long as the FIFO protocol is supported to ensure proper frame pacing and that apps/games won't possibly block presentation forever if the window is occluded. Switching SDL 2 at this point in its lifecycle is not likely to happen, as it would potentially break clients that depend on X being the default, and such a potentially breaking change doesn't really make sense with the final SDL 3 release on the horizon. |
On some Linux distributions, the X11 default just doesn't make too much sense even for legacy applications due to the touch problem. Is there an easy to maintain way to override the default in a way that won't affect SDL3? I assume setting |
I personally find the touch behavior being plain broken and the blurry scaling to be both such big issues that I would never want my application to launch with X11 at this point if Wayland is available. I'm wondering now, can I set this on the application side in some way that won't force Wayland to be used when in some time future, some other default than Wayland and X11 should ever arrive? |
Application-side, you can enumerate the available video drivers and set the driver hint programmatically. See |
As far as I can tell from the API overview there doesn't seem to be a way to get the default and only change it if it were to be X11 with Wayland available. In that case I could simply override the |
Hints set as envvars will automatically override hints set by the application, unless you use Also, it took 40 years for X to be supplanted by Wayland, and the transition is still ongoing, so I don't think we have to worry about a migration from Wayland to whatever else in our working lifetimes :). |
Well you never know, once apps are encouraged to overwrite this it's probably going to stay in there for a long time. This is why I think it might be a better idea to set a reasonable default. Given how many things break with X11 with SDL2, I don't think it's a good default in many cases. |
Even for the old SDL2, the "wayland" video driver seems to be vastly superior when using a Wayland desktop. The X11 backend of SDL2 seems to have major touch bugs, and it can cause blurriness if XWayland is configured to not let legacy apps scale themselves which sadly is often needed due to misbehaving applications other than SDL2. Using SDL_VIDEODRIVER=wayland manually fixes all this, but since most users won't do that, it will leave them with an unnecessarily bad out of the box experience unless the default changes.
Edit: if the reason this wasn't done is libdecor perhaps not being as widely available yet as desired, perhaps the default should be changed such that it defaults to wayland if libdecor is available, rather than never.
Tested with SDL2 version: 2.30.9
Tested on system: postmarketOS 24.12 Linux
Tested with compositor: kwin_wayland 6.2.4
The text was updated successfully, but these errors were encountered: