-
Notifications
You must be signed in to change notification settings - Fork 341
Getting started
wlroots ships with a pkg-config entry named wlroots, which should be compatible with most build systems. Compile and install wlroots normally, then link to pkg-config --libs wlroots
and add pkg-config --cflags wlroots
to your compiler flags (or whatever pretty way of doing this your particular build system encourages).
You also need to link to libwayland and wire up wayland-scanner
to scan any protocols you want to use. wlroots provides, for example, and xdg-shell implementation, but it expects you to call wayland-scanner
to generate the header before you include wlr/types/wlr_xdg_shell.h
. Our naming convention for Wayland protocol headers is to replace any dashes -
with underscores _
in the protocol name, then replace .xml
with _server.h
. You can get these XML files from wayland-protocols
(usually you want to reference the path specified by pkg-config --variable=pkgdatadir wayland-protocols
rather than copying these into your source tree), and for other protocols from wlr-protocols
.
We're still working on stabilizing the interface, and most interfaces are subject to change (though radical change is unlikely at this point). To this end, you need to pass -DWLR_USE_UNSTABLE
to your compiler to get anything serious done.
wlroots is largely documented through comments in the headers. Read 'em. Also check out tinywl.
We hang out in #sway-devel, an IRC channel on Libera Chat. Come in and ask questions.
- The Wayland Protocol (book)
- tinywl: a small Wayland compositor written with wlroots (annotated)
- Writing a Wayland Compositor, Part 1: Hello wlroots
- Writing a Wayland Compositor, Part 2: Rigging up the server
- Writing a Wayland Compositor, Part 3: Rendering a window
- Input handling in wlroots
- Writing a Wayland compositor with wlroots: shells
- Introduction to damage tracking
You are also encouraged to read the code of other projects using wlroots.