I started working on a game some months ago, and decided to use SFML. I love it so far, the API is nice, it's fast, it's native to C++. However, I've decided to move to SDL due to the lack of Wayland support, and I figured it might be valuable to outline some of my reasons why. The topic of Wayland support
has been discussed before, and the conclusion has mostly been that it's not necessary, and that XWayland works well enough.
Well, here are the reasons I have personally decided that relying on XWayland isn't good enough for my game;
- XWayland windows, on my compositor (Sway), don't support HiDPI. They're drawn at 1x resolution, then upscaled. My game uses pixel-art-y graphics, and paradoxically, upscaling pixel art doesn't work very well, because it looks blurry.
- Some desktops, like GNOME, have worked really hard to make XWayland windows look crips even on HiDPI screens. However, if you have one 2x screen and one 1x screen, the XWayland application will look fine on the primary screen, and either tiny or way too big on the secondary.
- The way XWayland forwards events to the X application results in an application which feels wrong. Particularly, touchpad scrolling is really rough.
I recently integrated imgui (via
imgui-sfml) into the game, and it really made those issues clear; the text looks blurry, touchpad scrolling feels weird, etc.
So, I kind of had three options:
- Live with the fact that my game feels like a second-class citizen on my own computer
- Patch SFML to add Wayland support
- Move to SDL
I seriously considered option 2, but since I'm working on this game next to work and studies, I would never get anywhere if I first had to patch SFML. Option 1 is obviously undesirable, so that leaves option 3.
I'm not making this post to try to guilt anyone into adding Wayland support to SFML. Nobody is owed Wayland support, XWayland works "well enough", and there are probably other tasks which one could reasonably judge to be higher priority. However, I just want to chime in and point out that it's not really the case that X11 still has first-class support. XWayland is more of a transitional kludge to keep old software working rather than a fully supported option. That's probably not going to change any time soon, and X11-only software is going to feel more and more out of place as the Linux desktop (slowly) moves toward Wayland.