Wayland Support in SDL 2.0.16
Much of my time for the past couple months has been focused on getting Wayland support complete for my catalog. With the Summer release of NVIDIA's Xwayland support, I am fully expecting Wayland use to rise dramatically throughout the rest of the year, so it seemed like it was time to start looking at native support myself. I have access to a full Wayland experience via flibitAMD, the AMD test box in my office, so I gave 2.0.14's Wayland backend a try.
It was... not great. Looking at the log I get the impression that it was mostly an experimental thing written mostly by one-off contributors, with occasional bursts of patches from SDL regulars getting slightly more frequent as time went on (because honestly, why bother up to this point? NV was blocking a ton of users and AMD/Intel were happy with Xwayland). But even as recently as this year, the delta between Wayland and X11 was huge. And we're about to see a huge jump in Wayland use. That's not scary or anything!
Previously it was my impression that client-side decorations were the only real blocker to setting Wayland as the default driver. Once I discovered how far off it really was, I made it my goal for Q1/Q2 2021 to get Wayland to the point where client-side decorations were actually the only real blocker. As of the latest commit on the main branch, I think I've achieved my goal. Just to get a sense of what it took:
- Fixing the build in general 1
- Writing a totally new messagebox implementation 1
- NEW as of April 21: Then reviewing a rewrite because I suck at security 1
- Implementing IME support 1 2
- Fixing clipboard support 1
- Making both resizable and fixed-size windows work, including toggling resizability: 1 2
- Making fullscreen support work, including high-DPI fullscreen 1 2 and a little gift for me
- Finishing keyboard support 1 plus a patch review
- NEW as of April 16: Fixing multimonitor support 1
- NEW as of April 18: A bunch of miscellaneous crap 1
- NEW as of April 20: Taking all this work and making it possible to hide it all 1
Yeah. Not exactly one feature away from being finished. But, after running the latest with my games, I can now comfortably recommend the Wayland backend to users whose desktops have server-side decoration support. For those on GNOME, this patch is what you care about.
At this point it will help move things along if people test the crap out of this backend. Luckily it is very easy to test with the following steps:
- Grab your distribution's build dependencies for SDL (i.e.
dnf builddep SDL2
) git clone git://github.com/libsdl-org/SDL.git; cd SDL; ./configure && make
- Launch games with
SDL_VIDEODRIVER=wayland SDL_DYNAMIC_API=/path/to/SDL/build/.libs/libSDL2-2.0.so.0 %command%
From what I can tell, Unity games wont boot at all (which is weird because I distinctly remember Unity employees telling me Wayland was why they moved to SDL), and my guess is Steam will not like it (the overlay depends on X for some reason), but the idea is that most games will just work as usual - the latest FNA has specifically been tested against Wayland including high-DPI scenarios, so those games are a good first test (even better if you can update FNA).
Issues should be filed at the SDL GitHub repository, but be sure what you discover doesn't also happen on X! If we can ensure that this is well-tested, we should be able to make it the default as soon as the libdecor ABI is officially frozen, which I'm hoping won't take much longer after Christian's patch is finished and working. My guess is, 2.0.16 will be the release that makes Wayland work for everybody except GNOME, then 2.0.18 will be the release that sets Wayland as default, provided nothing horrible happens and none of this stuff matters.
Future Games and Mac Support
This post has been archived.
GitHub Sponsors!
I'm happy to announce that I am now in the GitHub Sponsors program! This means that anyone with a GitHub account can now subscribe to a monthly payment system that will allow me to continue my work maintaining the numerous FOSS game development projects that I maintain, including FNA and FAudio.
You can find my sponsorship profile here.
If you're on the fence about this, I'll give you quite the incentive: Microsoft is skipping all payment processing fees, so in addition to taking extra money out of Microsoft's pocket (which I think my audience will take some joy in...), everything you pledge will go directly to me. A slight change of pace from Patreon's usual scams, hm?
I've been very vocal about the poor state of the crowdfunding ecosystem, and I think the GitHub Sponsors program is very much what we've all been looking for. I think you'll agree, and I hope you'll pledge what you can!
Want a Linux game?
I have my own hit list as always, but I'm always looking for more projects! Now's a really good time to hit me up while it's on my mind. Don't forget, whether you're an indie developer or an independent developer, there's a good chance I can accommodate your needs!
Love, flibit
flibitijibibo.com
Bill's Hat
Turn a minimal Fedora installation into a SteamOS box!
1. Write Fedora Workstation NetInstall ISO to a USB drive
2. Boot USB image, install Minimal configuration with standard partition layout matching SteamOS'
3. Set root password, create a user called 'steam', set a password for it
4. Reboot, log in as root
5. A whole bunch of commands:
dnf group install hardware-support
dnf install Xorg xorg-x11-drv-evdev libglvnd-egl vulkan-loader.x86_64 vulkan-loader.i686 lightdm flatpak NetworkManager-wifi kernel-modules-extra bluez
dnf config-manager --add-repo=https://negativo17.org/repos/fedora-steam.repo
dnf install steam steamos-compositor steamos-modeswitch-inhibitor.x86_64 steamos-modeswitch-inhibitor.i686
setsebool -P allow_execheap 1
systemctl enable sshd.service
systemctl enable lightdm.service
systemctl set-default graphical.target
6. Edit /etc/lightdm/lightdm.conf:
pam-service=lightdm-autologin
pam-autologin-service=lightdm-autologin
user-session=steamos
autologin-user=steam
autologin-session=steamos
7. Create /var/lib/AccountsService/users/steam:
[User]
Session=steamos
XSession=steamos
Icon=/home/steam/.face
SystemAccount=false
8. Reboot, should work now!
9. Additional steps for NVIDIA users:
dnf config-manager --add-repo=https://negativo17.org/repos/fedora-nvidia.repo
dnf install kernel-devel dkms-nvidia nvidia-driver-libs.x86_64 nvidia-driver-libs.i686
reboot # Should be using the NVIDIA driver now!
flibitBuild
Want to replicate my build machine? Grab CentOS 7 and have a look...
# Update base install before doing anything else
yum update
# Add EPEL
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# Add SCL
yum install centos-release-scl
# All the base build tools!
yum install bzip2 bzip2-devel clang cmake cmake3 gcc-c++ git hg \
libcxx-devel libstdc++-static libuuid-devel libxml2-devel llvm-devel \
lzma-sdk-devel openal-soft-devel openssl-devel patch svn yum-utils \
yum-plugin-copr
# SDL2 dependencies
yum-builddep SDL2
# Coprs for MinGW as well as GCC 8, needed to build Clang/LLVM/osxcross
yum copr enable mlampe/devtoolset-8
yum copr enable alonid/mingw-epel7
yum install devtoolset-8 mingw32-* mingw64-*
# CMake3 by default
alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake 10 \
--slave /usr/local/bin/ctest ctest /usr/bin/ctest \
--slave /usr/local/bin/cpack cpack /usr/bin/cpack \
--slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake \
--family cmake
alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 \
--slave /usr/local/bin/ctest ctest /usr/bin/ctest3 \
--slave /usr/local/bin/cpack cpack /usr/bin/cpack3 \
--slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \
--family cmake
# Also:
# Modify unistd.h to change __block to anything but __block
# The CMake config provided by SDL2-mingw is terrible, delete the block
# that starts with "if(NOT TARGET SDL2::SDL2)".
# Be prepared to pass -std=gnu99 manually. A LOT.
# To enter Mac building mode (and to build osxcross itself):
# scl enable devtoolset-8 bash
Wait, a "plan"?
Well, this is a .plan file, so here's my TODO. Expect nothing from it, ever.
In Progress
Jackbox Vulkan/SDL2 Testing
Codename HM05
VVVVVV 2.3 Release Candidate
Waiting Room
Codename Thermonuclear
- After Jackbox is cleared up
Codename Bison
- Just doing performance checks as requested
Codename FullCircle Returns
- Waiting on external negotiations
SDL Wayland
- Waiting on 2.0.16, libdecor, xdg-activation... lordy
FNA3D Vulkan
- Need to collect a ton of traces first
Star-Twine
- Builds are up, just keeping em refreshed until the big day
ScoreRush PC
- Need AppAdmin for publish, crosshair for mouse
Hades
- I think Dexter might do it?
Panzer Paladin
- Uhhhh?
Anodyne 1, TFoL
- These come after I'm not dead
Rhys
- Someone has to remove the XNA relinker
FNA Tutorial
- Leaving this alone for a bit
64-bit Panic
- Waveform repo :/
- Gotta rebuild all MojoSetup packages (F you Canonical)