Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Getting started

Simon Ser edited this page Dec 28, 2020 · 16 revisions

Integrating wlroots with your build

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.

Unstable features

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.

Documentation

wlroots is largely documented through comments in the headers. Read 'em. Also check out tinywl.

Support

We hang out in #sway-devel, an IRC channel on irc.freenode.net. Come in and ask questions.

Additional resources

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

You are also encouraged to read the code of other projects using wlroots

Clone this wiki locally