Wayland

The Wayland Protocol

Wayland logo

Kristian Høgsberg

Intel Corporation

Copyright © 2012 Kristian Høgsberg, Intel Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Abstract

Wayland is a protocol for a compositor to talk to its clients as well as a C library implementation of that protocol. The compositor can be a standalone display server running on Linux kernel modesetting and evdev input devices, an X application, or a Wayland client itself. The clients can be traditional applications, X servers (rootless or fullscreen) or other display servers.


Table of Contents

Preface
Acknowledgments
1. Introduction
Motivation
The compositing manager as the display server
2. Types of Compositors
System Compositor
Session Compositor
Embedding Compositor
3. Wayland Architecture
X vs. Wayland Architecture
Wayland Rendering
Hardware Enabling for Wayland
4. Wayland Protocol and Model of Operation
Basic Principles
Code Generation
Wire Format
Interfaces
Versioning
Connect Time
Security and Authentication
Creating Objects
Compositor
Surfaces
Input
Output
Data sharing between clients
5. X11 Application Support
Introduction
Two Modes for Foreign Windows
Architecture
X Window Manager (XWM)
A. Wayland Protocol Specification
wl_display - core global object
wl_registry - global registry object
wl_callback - callback object
wl_compositor - the compositor singleton
wl_shm_pool - a shared memory pool
wl_shm - shared memory support
wl_buffer - content for a wl_surface
wl_data_offer - offer to transfer data
wl_data_source - offer to transfer data
wl_data_device - data transfer device
wl_data_device_manager - data transfer interface
wl_shell - create desktop-style surfaces
wl_shell_surface - desktop-style metadata interface
wl_surface - an onscreen surface
wl_seat - group of input devices
wl_pointer - pointer input device
wl_keyboard - keyboard input device
wl_touch - touchscreen input device
wl_output - compositor output region
wl_region - region interface
wl_subcompositor - sub-surface compositing
wl_subsurface - sub-surface interface to a wl_surface
B. Client API
Introduction
wl_argument - Protocol message argument data types.
wl_array - Dynamic array.
wl_display - Represents a connection to the compositor and acts as a proxy to the wl_display singleton object.
wl_event_queue - A queue for wl_proxy object events.
wl_interface - Protocol object interface.
wl_list - Doubly-linked list.
wl_message - Protocol message signature.
wl_object - A protocol object.
wl_proxy - Represents a protocol object on the client side.
Functions
C. Server API
Introduction
wl_argument - Protocol message argument data types.
wl_array - Dynamic array.
wl_client
wl_display
wl_event_loop - An event loop context.
wl_event_source - An abstract event source.
wl_global
wl_interface - Protocol object interface.
wl_list - Doubly-linked list.
wl_listener - A single listener for Wayland signals.
wl_message - Protocol message signature.
wl_object - A protocol object.
wl_protocol_logger
wl_protocol_logger_message
wl_resource
wl_resource_iterator_context
wl_shm_buffer - A SHM buffer.
wl_shm_pool
wl_shm_sigbus_data
wl_signal - A source of a type of observable event.
wl_socket
Functions

List of Figures

3.1. X architecture diagram
3.2. Wayland architecture diagram
5.1. Xwayland architecture diagram