Make X11 dependency optional
Currently Mutter can't be built as a Wayland only compositor. The goal of this issue is to track the various tasks in order to achieve that.
-
Make XWayland optional
PR: !2399 (merged) -
Move X11 windows frames to a separate client
PR: !2175 (merged) -
Remove GTK usage from libmutter
as it brings X11 dependencies indirectly fromGDK
->GDK X11
It would require a small patch to GNOME Shell (the infra from Mutter side is already handled on the PR below) so that the producer/consumer for key events is Mutter and no longer GTK.
Depends on: !2175 (merged)
PR: !2407 (merged)
This PR would also makeGDK
aX11
specific dependency -
Cursor loading: Currently mutter uses xcursor
which handles loading the cursor assets from the user theme. There is no replacement. We could have an in-tree copy of what we need fromxcursor
. GTK 4 seems to do a similar thing, see https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gdk/wayland/cursor/xcursor.c.
Usinglibwayland-cursor
is not an option here as it doesn't allow us to get access to the internalCursor
type and rather give us awl_buffer
so we can't share the same code between X11/Wayland backends. At the end of the day, it also has an in-tree copy ofxcursor
. -
Use GLES instead of GL, it seems GL brings back x11 through GLX. It should be a matter of replacingIt should probably begl
pkg-config withglesv2
.egl
-
Keybindings: Couldn't come up with an idea by looking at the code, maybe we could have a common base class and have different implementation per backend instead of a bunch of if(!is_wayland_compositor()) return
all over the place -
jadahl has done some work as part of !2392 (closed) to split the X11/Wayland Barrier implementations. -
Command Line: Error out when Wayland/X11 specific backends options are used and the corresponding backend is disabled at build time -
Untangle _meta_window_shared_new
, as it takes x11/wayland specific arguments and there should probably be two variants and a post construction common function -
Add a CI job for the new build configurations: -
Wayland only -
X11 only
-
-
Error out if startup-notification
is enabled but notx11
The remaining task would be to ensure that we are properly disabling X11/XWayland specific code
I have already managed to do a quick build without X11 stuff
ldd _build/src/mutter
linux-vdso.so.1 (0x00007ffe6853d000)
libmutter-10.so.0 => /var/home/bilelmoussaoui/Projects/mutter/_build/src/libmutter-10.so.0 (0x00007f223c68f000)
libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007f223c548000)
libgio-2.0.so.0 => /lib64/libgio-2.0.so.0 (0x00007f223c36d000)
libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x00007f223c30e000)
libwayland-client.so.0 => /lib64/libwayland-client.so.0 (0x00007f223c2fc000)
libc.so.6 => /lib64/libc.so.6 (0x00007f223c0f9000)
libmutter-cogl-10.so.0 => /var/home/bilelmoussaoui/Projects/mutter/_build/src/../cogl/cogl/libmutter-cogl-10.so.0 (0x00007f223c055000)
libmutter-clutter-10.so.0 => /var/home/bilelmoussaoui/Projects/mutter/_build/src/../clutter/clutter/libmutter-clutter-10.so.0 (0x00007f223bf0c000)
libgraphene-1.0.so.0 => /lib64/libgraphene-1.0.so.0 (0x00007f223beed000)
libwayland-server.so.0 => /lib64/libwayland-server.so.0 (0x00007f223bed7000)
libEGL.so.1 => /lib64/libEGL.so.1 (0x00007f223bec4000)
libGLESv2.so.2 => /lib64/libGLESv2.so.2 (0x00007f223beaf000)
libcairo.so.2 => /lib64/libcairo.so.2 (0x00007f223bd63000)
libgmodule-2.0.so.0 => /lib64/libgmodule-2.0.so.0 (0x00007f223bd5c000)
libgdk_pixbuf-2.0.so.0 => /lib64/libgdk_pixbuf-2.0.so.0 (0x00007f223bd2c000)
libm.so.6 => /lib64/libm.so.6 (0x00007f223bc4e000)
libcairo-gobject.so.2 => /lib64/libcairo-gobject.so.2 (0x00007f223bc42000)
libpango-1.0.so.0 => /lib64/libpango-1.0.so.0 (0x00007f223bbd8000)
libcanberra.so.0 => /lib64/libcanberra.so.0 (0x00007f223bbc4000)
libxkbcommon.so.0 => /lib64/libxkbcommon.so.0 (0x00007f223bb7b000)
libgudev-1.0.so.0 => /lib64/libgudev-1.0.so.0 (0x00007f223bb6d000)
libudev.so.1 => /lib64/libudev.so.1 (0x00007f223bb40000)
libpipewire-0.3.so.0 => /lib64/libpipewire-0.3.so.0 (0x00007f223ba62000)
libsystemd.so.0 => /lib64/libsystemd.so.0 (0x00007f223b983000)
libdrm.so.2 => /lib64/libdrm.so.2 (0x00007f223b96c000)
libinput.so.10 => /lib64/libinput.so.10 (0x00007f223b918000)
libgbm.so.1 => /lib64/libgbm.so.1 (0x00007f223b907000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f223b88d000)
libz.so.1 => /lib64/libz.so.1 (0x00007f223b873000)
libmount.so.1 => /lib64/libmount.so.1 (0x00007f223b82a000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f223b7fe000)
libffi.so.8 => /lib64/libffi.so.8 (0x00007f223b7f2000)
/lib64/ld-linux-x86-64.so.2 (0x00007f223c8cf000)
libmutter-cogl-pango-10.so.0 => /var/home/bilelmoussaoui/Projects/mutter/_build/src/../clutter/clutter/../../cogl/cogl-pango/libmutter-cogl-pango-10.so.0 (0x00007f223b7e6000)
libatk-1.0.so.0 => /lib64/libatk-1.0.so.0 (0x00007f223b7bc000)
libjson-glib-1.0.so.0 => /lib64/libjson-glib-1.0.so.0 (0x00007f223b78e000)
libfribidi.so.0 => /lib64/libfribidi.so.0 (0x00007f223b76e000)
libpangocairo-1.0.so.0 => /lib64/libpangocairo-1.0.so.0 (0x00007f223b75c000)
libpangoft2-1.0.so.0 => /lib64/libpangoft2-1.0.so.0 (0x00007f223b741000)
libfontconfig.so.1 => /lib64/libfontconfig.so.1 (0x00007f223b6f2000)
libGLdispatch.so.0 => /lib64/libGLdispatch.so.0 (0x00007f223b639000)
libpng16.so.16 => /lib64/libpng16.so.16 (0x00007f223b5fd000)
libfreetype.so.6 => /lib64/libfreetype.so.6 (0x00007f223b530000)
libpixman-1.so.0 => /lib64/libpixman-1.so.0 (0x00007f223b482000)
libjpeg.so.62 => /lib64/libjpeg.so.62 (0x00007f223b3fe000)
libthai.so.0 => /lib64/libthai.so.0 (0x00007f223b3f3000)
libharfbuzz.so.0 => /lib64/libharfbuzz.so.0 (0x00007f223b308000)
libvorbisfile.so.3 => /lib64/libvorbisfile.so.3 (0x00007f223b2fd000)
libtdb.so.1 => /lib64/libtdb.so.1 (0x00007f223b2e4000)
libltdl.so.7 => /lib64/libltdl.so.7 (0x00007f223b2d8000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f223b2b8000)
liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f223b28b000)
libzstd.so.1 => /lib64/libzstd.so.1 (0x00007f223b1d8000)
liblz4.so.1 => /lib64/liblz4.so.1 (0x00007f223b1b4000)
libcap.so.2 => /lib64/libcap.so.2 (0x00007f223b1aa000)
libgcrypt.so.20 => /lib64/libgcrypt.so.20 (0x00007f223b06d000)
libmtdev.so.1 => /lib64/libmtdev.so.1 (0x00007f223b066000)
libevdev.so.2 => /lib64/libevdev.so.2 (0x00007f223b048000)
libwacom.so.9 => /lib64/libwacom.so.9 (0x00007f223b037000)
libexpat.so.1 => /lib64/libexpat.so.1 (0x00007f223b00b000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f223add7000)
libblkid.so.1 => /lib64/libblkid.so.1 (0x00007f223ad9e000)
libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007f223ad08000)
libxml2.so.2 => /lib64/libxml2.so.2 (0x00007f223ab7b000)
libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f223ab68000)
libbrotlidec.so.1 => /lib64/libbrotlidec.so.1 (0x00007f223ab5b000)
libdatrie.so.1 => /lib64/libdatrie.so.1 (0x00007f223ab52000)
libgraphite2.so.3 => /lib64/libgraphite2.so.3 (0x00007f223ab30000)
libvorbis.so.0 => /lib64/libvorbis.so.0 (0x00007f223aafe000)
libogg.so.0 => /lib64/libogg.so.0 (0x00007f223aaf3000)
libgpg-error.so.0 => /lib64/libgpg-error.so.0 (0x00007f223aacd000)
libbrotlicommon.so.1 => /lib64/libbrotlicommon.so.1 (0x00007f223aaaa000)