Writing a wayland server (or compositor) Everything you need to know about the wayland implementation library is documented in the wayland book [0]. To sum it up, here is what a compositor does: - create a display - expose a socket for client communication - setup listeners for "interfaces" it supports - run its "event loop" The most important word here is "interfaces", which are protocols that the server supports. These interfaces define how the client can interact with the server, and which features are available. Interfaces in wayland are defined as XML files, usually present in /usr/lib/wayland-protocols. These XML file are used by the wayland-scanner(1) tool to generate C headers and glue code for both the client and server: ``` wayland-scanner server-header < clipboard.xml > clipboard.h wayland-scanner private-code < clipboard.xml > clipboard.c ``` [0]: https://wayland-book.com