non-XOrg Wayland
Warning: This is Wayland without any of libX11
or related (ie. libGL.so
instead of libOpenGL.so
) in the system, this also removes the XWayland
compatibility layer as it's an xorg-server component.
You can find this kind of similar setup in embedded systems (ie. SailfishOS), as X11 makes no sense outside of keyboard+mouse setups, but I don't expect it until a bunch of years for regular desktops (say when X.Org will have died), I'm doing this right now to avoid having to rush to get rid of X11 with having to push the End-of-Life date way back it's upstream date (that happened with python-2 because it wasn't much prepared until the last year or two).
It's also the kind of setup that I expect soon in security-oriented systems because Wayland addresses a number of design flaws.
Testing is done on Gentoo Linux with USE="-X -XWayland"
and -DEGL_NO_X11
into the C(XX)FLAGS
. And launched into the Sway compositor.
Reminder:
- static linking
- (
LDFLAGS="-static"
) some of the library is copied in the executable - shared linking
- (
LDFLAGS="-shared"
) system library likeld-linux-x86-64.so.2
loading the libraries before execution - dynamic
linkingloading - (
dlopen()
) loading a library during the execution
NoVidya reminder
Do not ask Libre software developers for support of the NVidia proprietary driver, specially when they already refused, the driver being proprietary means that any bug found has to be worked around, which often isn't possible without compromising performance and stability.
Also, in terms of history:
- After almost 10 years NVidia has yet to provide a complete enough driver for Wayland
- Instead of providing the GBM API like everyone else, including other proprietary drivers (there is a lot of them on the embedded side of things), they created EGLStreams, which means a very large chunk of code (and so bugs) specific to NVidia
- Contributes to a huge waste of chips by stopping the support of GPUs after about 5 years
- Has basically been trashing any hope for nouveau to be a complete driver (check FOSDEM videos of the nouveau developers)
- NVidia performance vs. AMDGPU performance on linux doesn't have a very large gap on real-life loads
- Doesn't provides async reprojection on linux, so no VR for you (Or a lot of those nice Vulkan speedups)
- Remember how awful Nvidia Optimus is?
- Garbage video decoder driver
Buildsystems
I've yet to see one work correctly out of the box for this. The snippets in this section Abandons all copyrights if it could even begin to be copyrightable, as I can't assign to the Public Domain in France, they are distributed under any OSI/FSF-approuved license including CC-0, WTFPL, Unlicense and BSD-0.
CMake
- Replace
find_package(OpenGL REQUIRED)
to something likefind_package(OpenGL COMPONENTS OpenGL REQUIRED)
. This allows to not error out when libGL.so isn't found but libOpenGL.so is. - Replace
OPENGL_gl_LIBRARY
toOPENGL_opengl_LIBRARY
. This will allow to use libOpenGL.so over libGL.so when possible.
Auto*hell
Use something like the following:
AC_CHECK_HEADER(
[GL/gl.h],
AC_SEARCH_LIBS(glBegin, [opengl32 GL GL2 OpenGL], [test $ac_cv_search_glBegin = "none required" || GL_LIBS="$ac_cv_search_glBegin $GL_LIBS"], [AC_MSG_ERROR(*** OpenGL library not found on system!)]),
[AC_MSG_ERROR(*** OpenGL headers not found on system!)]
)
meson
Nice fail of an otherwise nice mainly declarative buildsystem there…
gl_dep = dependency('gl', required: false)
if not gl_dep.found()
# libglvnd fallback for libX11-less wayland systems
gl_dep = dependency('opengl')
endif
Librairies
- Qt 5 and later: Yes, Just Works
- libepoxy: Just Works
- waffle Yes, use 1.7.0+ for support in modern compositors
- löve(2d) (0.10.2+, tested with 11.3 + lua5.2): Yes, it's SDL2-based after all.
- SDL2 (2.0.14): Yes, very close to working entirely out-of-the-box. Some workarounds being:
- For 2.0.14 and earlier: Needing to set
SDL_VIDEO_GL_DRIVER=libOpenGL.so
or patch libSDL2 (SDL#4158). - When bundled in binairies: Needing to set
SDL_DYNAMIC_API
to where your distro'slibSDL2.so
library is.
- For 2.0.14 and earlier: Needing to set
- GTK 3 and later: Almost. Suggestions are broken on multi-monitors as well as the usual glitches.
- FreeGLUT: free OpenGL utility toolkit: No, depends on
wl_shell
which is absent in wlroots and probably others (See FreeGLUT#72) - allegro-4: Maybe, compiles with OpenGL enabled
- allegro-5: Doesn't seems to, with OpenGL enabled (required for some games) it pulls
GL/glx.h
. Also has code loading only "libGL.so". - GLEW: OpenGL Extension Wrangler Library: Not really, consider libepoxy or glbinding (drop-in). I managed to get it to compile with:
- Applying Extend GLEW API to support glewContextInit - GL without implied GLX, … #216
- Running
sed -i 's/-lGL/-lOpenGL/' config/Makefile.linux-egl
- Passing
POPT="${CFLAGS} -D__native_client__"
andSYSTEM=linux-egl
to make options, for both build and install
- FLTK: Nope, could be there in the future(1.4.x) see STR #3371
- TCL/TK: Nope, but there is undroidwish apparently supporting it, GSoC idea page
- irrlicht: Nope, there is some community work on it
- SFML: Simple and Fast Multimedia Library: Nope
- godot: No wayland support yet. godot-proposals#990
Web Browsers
- Badwolf: Yes, Fully tested and supported as first-class citizen
- epiphany - Gnome Web: Yes, seems to work fine, should be well supported
- netsurf: GTK3 frontend just works
- Mozilla Firefox: No, requires X11 libs and Wayland support is quite bugged, screen grabbing doesn't works without xdg-desktop-portal (dbus-based) and the indicator has it's own top-level window
- chromium: Not really, requires to enable ozone, which probably means compiling it yourself (You had one job binary-based distros)
Games
Just Works
- oshu: Yes, just Works (SDL2)
- Blob Wars : Attrition: Yes, Just Works (SDL2)
- VVVVVV: Yes, Just Works (SDL2)
- Superflu Riteurnz: Yes, just Works (SDL2)
- abuse (Crack.Com): Yes, Just Works
- open-supaplex: Just Works
- nxengine-evo (Cave Story modern engine): Just Works
- StabYourself games compatible with love-11.3 ( not-tetris-3, text-based-golf, text-based-sokoban, mari0, notdonkeykong, orderoftwilight, …): Just Works
Needed a bit of work
- SuperTux:
No, because of GLEWYes, changed it's build configuration to use glbinding - endless-sky: Almost, had to change linking from
GL
toOpenGL
inSConstruct
, no proper detection done - freeciv: Yes(SDL2 and Qt5 clients) and No(GTK+2 client, the default/goto one)
- SuperTuxKart: Quite, works in wayland with gles2(because irrlicht tries to dynamically load
libGL.so.1
otherwise) in current git (9f1ae2b7619f21546cc5cdd4bbeea53492d4b7ac
) - seven-kingdoms: Seems to work fine
- Xash3D FWGS + HLSDK Xash3D: Yes, has some glitches but seems unrelated to Wayland. Note: You need to set
SDL_VIDEO_GL_DRIVER=libOpenGL.so
orBOX86_LIBGL=libOpenGL.so
- taisei: Need to set
SDL_VIDEO_GL_DRIVER=libOpenGL.so
or patch libSDL2 (SDL#4158). - neverball: Works with OpenGL ES(
make ENABLE_OPENGLES=1
), segfaults with OpenGL(which needssed -i s;-lGL;-lOpenGL; Makefile
) - pingus: Displays with a small patch(pingus!191), story mode segfaults but seems unrelated.
- FTE Quake World(Quake Game Engine): Kind of, works in weston (with the legacy
"wl_shell"
) but doesn't in sway, it fails to hook to"xdg_wm_base"
properly. - Excavation Site Mercury: Need to set
SDL_DYNAMIC_API
to where your distro'slibSDL2.so
library is - Baba Is You (Humble Bundle): Needs to run
patchelf --replace-needed libGL.so.1 libOpenGL.so.0 bin64/Chowdren
and setSDL_DYNAMIC_API
to where your distro'slibSDL2.so
library is
Doesn't works
- wesnoth: No, some basic actions are broken
- astromenace: No, window fades from white to black, still get proper sound, including input feedback
- OpenRA: No, fails at runtime.
Unsupported OpenGL version: OpenGL ES 3.2 Mesa 20.1.10
- bzflag: No, sets
-lX11
without testing at configuration time, needssed -i 's;\[opengl32 GL GL2\];[opengl32 GL GL2 OpenGL];' configure.ac
and depends on GLEW - xonotic: No, depends on X11
- dwarf fortress: No, hard-depends on GTK2+ and libSDL-1
- armagetronad: Black screen in current trunk(
0ba8c6ff0aeda14d86760a1744c6296cbf8632be
) - Secret Maryo Chronicles: No, hard depends on X11
- TSC: The Secret Chronicles of Dr. M.: No, because of SFML
- Extreme Tux Racer: No, because of SFML
- Mindustry: Nope,
libsdl-arc64.so
is shared linked againstlibGL.so.1
- oolite: Nope, still on SDL-1.2
- Chromium B.S.U: No, I get a grey window that flashes to red from time to time. Tested on master's branch at commit
86b985c5c386410371b48b4169aec14b81007a59
- OpenRiichi: Vala looks like a mess to make it work with
libOpenGL.so
instead.
Multimedia
- mpv: Yes, Just Works
- MyPaint: Yes, Just Works
- dustr (light interactive cropping tool): Yes, Just Works
- evince: Yes, Just Works
- Inkscape: Yes, Just Works
- gstreamer: Mostly, only lacks wlr-based screen grabbing
- imv (IMage Viewer): Sort-of, needs a patch for
-lGL
to-lOpenGL
(my PR for it) - Krita: Works, including tablet support. Had to switch Qt to full OpenGL instead of GLES and remove qtx11extra stuff in two
CMakeList.txt
files. - Mumble: No, requires libXext (own PR for making it optionnal)
- OBS Studio: No, requires X11 libs including in feaneron's
egl-wayland
branch - azpainter: No, depends on X11
Emulator / Compat-layer
- SCUMMVM: Yes, seems to just work
- QEMU: Yes, screen resize is a bit bugged (needs unfocus-refocus in sway)
- Wine: Quite, works with alf's wayland branch(
ce0da9c9f646536df40c2fa2869482edee0b1b1e
) + own lazy patch for libOpenGL.so - DOSBox Staging (0.76.0): Yes, without OpenGL
- GNU EMACS: Soon, works in
feature/pgtk
branch and passing--with-pgtk
to./configure
- plan9port: No, doesn't seems to have a wayland port yet
Misc
- kristall (Qt Gemini Browser): Yes, Just Works
- xournalpp: Almost, needed a patch(xournalpp#2934)
- Mesa Demos: Nope
See Also
- Awesome Wayland: curated list of Wayland code and resources
- Are We Wayland yet?
- Using wf-recorder as camera
- on abandoning the X server