How xquartz/wayland works
Wayland defines a compositor–client protocol and provides libraries implementing its client and server sides. The main workflow is a client connecting to a compositor, sending protocol requests and buffer-related data, and receiving events; the compositor handles input and forwards relevant events to clients. The repository also includes protocol metadata and scanner tooling, shared-memory support, EGL integration, and cursor-theme loading. Some runtime links are documented rather than visible in the excerpts, so those are marked unverified.
Main entry points: wayland-server.c Server API · wayland-client.c Client API · connection.c Wire connection · wayland-cursor.c Cursor themes
Components 20
Protocol
- Protocol definition
protocol/wayland.xml - Protocol scanner
src/scanner.c
Client runtime
- Client API
src/wayland-client.c - Client API declarations
src/wayland-client-core.h - Wire connection
src/connection.c - OS support
src/wayland-os.c - Shared utilities
src/wayland-util.c - Protocol encoding
src/wayland-private.h
Server runtime
- Server API
src/wayland-server.c - Server API declarations
src/wayland-server-core.h - Event loop
src/event-loop.c - Shared memory
src/wayland-shm.c
Client extensions
- Cursor themes
cursor/wayland-cursor.c - Xcursor loading
cursor/xcursor.c - Built-in cursor data
cursor/cursor-data.h - Cursor OS support
cursor/os-compatibility.c - Wayland EGL window
egl/wayland-egl.c - EGL backend interface
egl/wayland-egl-backend.h
Other components
- Client application
- Compositor
Connections 22
- Client application → Client API: uses
- Client API → Wire connection: transfers messages
- Client API → Protocol encoding: marshals requests
src/wayland-client.c - Client API → Client API declarations: implements API
- Client API → OS support: uses OS support
src/wayland-client.c - Wire connection → Shared utilities: uses
src/connection.c - Wire connection → OS support: uses OS support
src/connection.c - Compositor → Server API: uses
README.md - Server API → Wire connection: exchanges messages
- Server API → Server API declarations: implements API
src/wayland-server.c - Server API → Shared utilities: uses
src/wayland-server.c - Server API → OS support: uses OS support
src/wayland-server.c - Shared memory → Server API: uses server API
src/wayland-shm.c - Event loop → Server API declarations: uses server API
src/event-loop.c - Client application → Protocol definition: follows protocol
README.md - Compositor → Protocol definition: follows protocol
README.md - Protocol scanner → Protocol definition: reads definitions
- Cursor themes → Xcursor loading: loads themes
cursor/wayland-cursor.c - Cursor themes → Built-in cursor data: uses built-in data
cursor/wayland-cursor.c - Cursor themes → Cursor OS support: allocates shared files
cursor/wayland-cursor.c - Wayland EGL window → EGL backend interface: uses backend interface
egl/wayland-egl.c - Wayland EGL window → Client application: provides EGL integration