libdecor is a library that can help Wayland clients draw window decorations for them. It aims to provide multiple backends that implements the decoration drawing.
Required:
meson
>= 0.47ninja
wayland-client
>= 1.18wayland-protocols
>= 1.15wayland-cursor
cairo
pangocairo
Recommended:
dbus-1
(to query current cursor theme)
Optional
egl
(to build EGL example)xkbcommon
(to build cairo demo)
Install via apt:
sudo apt install meson libwayland-dev wayland-protocols libpango1.0-dev libdbus-1-dev libegl-dev libxkbcommon-dev
Install via dnf:
sudo dnf install meson wayland-devel wayland-protocols-devel pango-devel dbus-devel mesa-libEGL-devel libxkbcommon-devel
Newer meson versions can be installed via pip: pip3 install -U meson
.
To build and run the example program:
meson build && meson compile -C build
LIBDECOR_PLUGIN_DIR=build/src/plugins/cairo/ ./build/demo/libdecor-demo
The library and default plugins can be built and installed via:
meson build --buildtype release
meson install -C build
where build
is the build directory that will be created during this process.
This will install by default to /usr/local/
. To change this set the prefix
during built, e.g. meson build --buildtype release -Dprefix=$HOME/.local/
.
Plugins will be installed into the same directory and from thereon will be selected automatically depending on their precedence. This behaviour can be overridden at runtime by setting the environment variable LIBDECOR_PLUGIN_DIR
and pointing it to a directory with a valid plugin.
During development and when debugging, it is recommended to enable the AddressSanitizer and increase the warning level:
meson build -Db_sanitize=address -Dwarning_level=3
meson compile -C build
You may have to install libasan6
(apt) or libasan
(dnf). Otherwise linking will fail.
By default libdecor
will look for plugins in the target directory of the installation. Therefore, when running the demos directly from the build
directory, no plugins will be found and the fallback plugin without any decorations will be used.
The search path for plugins can be overridden by the environment variable LIBDECOR_PLUGIN_DIR
. To use the cairo
plugin, point to the plugin directory:
export LIBDECOR_PLUGIN_DIR=build/src/plugins/cairo/
and run the demo:
./build/demo/libdecor-demo
.