1
Feature requests / Re: So, I'm moving away from SFML due to Wayland support
« on: October 25, 2019, 01:13:07 pm »The linked forum thread is from 2013 and the issue is from 2016 (and didn't really discuss any concrete benefits of supporting Wayland other than "it's the new thing").
Yeah, I should've mentioned something about that; it was certainly a good decision, especially in 2013, to focus development on other things. However, I haven't seen any discussion more recent than the 2016 issue, and as you point out, they didn't actually mention reasons for supporting Wayland other than that it's new, so I figured it was time for a new discussion.
The question then is: do we still need to support X11? Are there X11 emulation layers that work on top of Wayland (like XWayland, but the other way round)? Or is Wayland so widely adopted now that nobody relies on X11 anymore?
X11 will certainly be relevant for a long time still. Even when shipping Wayland by default, distros will continue to have X11 as a fallback for the foreseeable future, and as long as NVidia refuses to play ball, people who need to use their proprietary drivers will use X11 (there is some progress on getting support for their weird non-standard stuff into GNOME and KDE, but the wlroots project has essentially said that they won't duplicate all their hardware acceleration effort just because of NVidia).
The "proper" way to do Wayland support seems to be to detect whether the user is on X11 or Wayland based on environment variables at runtime, at least that's what Qt and GTK does. It can't be purely a compile-time option.
I'm not aware of any compatibility layer for running Wayland-only applications on X11, but it should be possible to make one. A lot of the existing compositors can already run as an X11 window within an X session, so making a reverse XWayland (WaylandX?) would "just" involve taking a compositor (say, wlroots) and make it ensure that the wayland window always fills the entire surface of the compositor (plus making the X11 window's title bar match the Wayland window's title bar and such).
I suspect that wouldn't be as good as the current native X11 backend though, and creating and maintaining that compatibility layer would probably be more work than maintaining two separate windowing system backends for unix.