blob: 7a65c9525515b53f7f53c9d020da70ba9af82eca [file] [log] [blame] [view]
Simon Ser733de762019-11-21 11:25:001# Wayland protocols
2
3wayland-protocols contains Wayland protocols that add functionality not
4available in the Wayland core protocol. Such protocols either add
5completely new functionality, or extend the functionality of some other
6protocol either in Wayland core, or some other protocol in
7wayland-protocols.
8
9A protocol in wayland-protocols consists of a directory containing a set
10of XML files containing the protocol specification, and a README file
11containing detailed state and a list of maintainers.
12
Jonas Ådahl5381e392020-11-18 15:56:3813## Protocol phases
14
15Protocols in general has three phases: the development phase, the testing
16phase, and the stable phase.
17
18In the development phase, a protocol is not officially part of
19wayland-protocols, but is actively being developed, for example by
20iterating over it in a
21[merge
22request](https://gitlab.freedesktop.org/wayland/wayland-protocols/merge_requests),
23or planning it in an
24[issue](https://gitlab.freedesktop.org/wayland/wayland-protocols/issues).
25
26During this phase, patches for clients and compositors are written as a test
27vehicle. Such patches must not be merged in clients and compositors, because
28the protocol can still change.
29
30When a protocol has reached a stage where it is ready for wider adoption,
31and after the [GOVERNANCE section
322.3](GOVERNANCE.md#2.3-introducing-new-protocols) requirements have been
33met, it enters the "testing" phase. At this point, the protocol is added
34to `staging/` directory of wayland-protocols and made part of a release.
35What this means is that implementation is encouraged in clients and
36compositors where the functionality it specifies is wanted.
37
38Extensions in staging cannot have backward incompatible changes, in that
39sense they are equal to stable extensions. However, they may be completely
40replaced with a new major version, or a different protocol extension all
41together, if design flaws are found in the testing phase.
42
43After a staging protocol has been sufficiently tested in the wild and
44proven adequate, its maintainers and the community at large may declare it
45"stable", meaning it is unexpected to become superseded by a new major
46version.
47
48## Deprecation
49
50A protocol may be deprecated, if it has been replaced by some other
51protocol, or declared undesirable for some other reason. No more changes
52will be made to a deprecated protocol.
53
54## Legacy protocol phases
55
56An "unstable" protocol refers to a protocol categorization policy
57previously used by wayland-protocols, where protocols initially
58placed in the `unstable/` directory had certain naming conventions were
59applied, requiring a backward incompatible change to be declared "stable".
60
61During this phase, protocol extension interface names were in addition to
62the major version postfix also prefixed with `z` to distinguish from
63stable protocols.
64
Simon Ser733de762019-11-21 11:25:0065## Protocol directory tree structure
66
Jonas Ådahl5381e392020-11-18 15:56:3867Depending on which stage a protocol is in, the protocol is placed within
68the toplevel directory containing the protocols with the same stage.
69Stable protocols are placed in the `stable/` directory, staging protocols
70are placed in the `staging/` directory, and deprecated protocols are
71placed in the `deprecated/` directory.
Simon Ser733de762019-11-21 11:25:0072
Jonas Ådahl5381e392020-11-18 15:56:3873Unstable protocols (see [Legacy protocol phases](#legacy-protocol-phases))
74can be found in the `unstable/` directory, but new ones should never be
75placed here.
Simon Ser733de762019-11-21 11:25:0076
77## Protocol development procedure
78
79To propose a new protocol, create a GitLab merge request adding the
80relevant files and Makefile.am entry to the repository with the
81explanation and motivation in the commit message. Protocols are
82organized in namespaces describing their scope ("wp", "xdg" and "ext").
83There are different requirements for each namespace, see [GOVERNANCE
84section 2](GOVERNANCE.md#2-protocols) for more information.
85
86If the new protocol is just an idea, open an issue on the GitLab issue
87tracker. If the protocol isn't ready for complete review yet and is an
88RFC, create a merge request and add the "WIP:" prefix in the title.
89
90To propose changes to existing protocols, create a GitLab merge request.
91
Simon Ser733de762019-11-21 11:25:0092## Interface naming convention
93
94All protocols should avoid using generic namespaces or no namespaces in
95the protocol interface names in order to minimize risk that the generated
96C API collides with other C API. Interface names that may collide with
97interface names from other protocols should also be avoided.
98
99For generic protocols not limited to certain configurations (such as
100specific desktop environment or operating system) the `wp_` prefix
101should be used on all interfaces in the protocol.
102
103For protocols allowing clients to configure how their windows are
104managed, the `xdg_` prefix should be used.
105
106For operating system specific protocols, the interfaces should be
107prefixed with both `wp_` and the operating system, for example
108`wp_linux_`, or `wp_freebsd_`, etc.
109
110For more information about namespaces, see [GOVERNANCE section 2.1
111](GOVERNANCE.md#21-protocol-namespaces).
112
Jonas Ådahl5381e392020-11-18 15:56:38113Each new protocol XML file must include a major version postfix, starting
114with `-v1`. The purpose of this postfix is to make it possible to
115distinguish between backward incompatible major versions of the same
116protocol.
Simon Ser733de762019-11-21 11:25:00117
Jonas Ådahl5381e392020-11-18 15:56:38118The interfaces in the protocol XML file should as well have the same
119major version postfix in their names.
Simon Ser733de762019-11-21 11:25:00120
Jonas Ådahl5381e392020-11-18 15:56:38121For example, the protocol `foo-bar` may have a XML file
122`foo-bar/foo-bar-v1.xml`, consisting of the interface `wp_foo_bar_v1`,
123corresponding to the major version 1, as well as the newer version
124`foo-bar/foo-bar-v2.xml` consisting of the interface `wp_foo_bar_v2`,
125corresponding to the major version 2.
Simon Ser733de762019-11-21 11:25:00126
Jonas Ådahl5381e392020-11-18 15:56:38127## Include a disclaimer
Simon Ser733de762019-11-21 11:25:00128
Jonas Ådahl5381e392020-11-18 15:56:38129Include the following disclaimer:
Simon Ser733de762019-11-21 11:25:00130
Jonas Ådahl5381e392020-11-18 15:56:38131```
132Warning! The protocol described in this file is currently in the testing
133phase. Backward compatible changes may be added together with the
134corresponding interface version bump. Backward incompatible changes can
135only be done by creating a new major version of the extension.
136```
Simon Ser733de762019-11-21 11:25:00137
Jonas Ådahl5381e392020-11-18 15:56:38138## Backward compatible protocol changes
Simon Ser733de762019-11-21 11:25:00139
Jonas Ådahl5381e392020-11-18 15:56:38140A protocol may receive backward compatible additions and changes. This
141is to be done in the general Wayland way, using `version` and `since` XML
142element attributes.
Simon Ser733de762019-11-21 11:25:00143
Jonas Ådahl5381e392020-11-18 15:56:38144## Backward incompatible protocol changes
145
146While not preferred, a protocol may at any stage, especially during the
147testing phase, when it is located in the `staging/` directory, see
148backward incompatible changes.
Simon Ser733de762019-11-21 11:25:00149
150Assuming a backward incompatible change is needed, the procedure for how to
151do so is the following:
152
153- Make a copy of the XML file with the major version increased by 1.
154- Increase the major version number in the protocol XML by 1.
155- Increase the major version number in all of the interfaces in the
156 XML by 1.
Jonas Ådahl5381e392020-11-18 15:56:38157- Reset the interface version number (interface version attribute) of all
Simon Ser733de762019-11-21 11:25:00158 the interfaces to 1.
Jonas Ådahl5381e392020-11-18 15:56:38159- Remove all of the `since` attributes.
Simon Ser733de762019-11-21 11:25:00160
161## Declaring a protocol stable
162
Jonas Ådahl5381e392020-11-18 15:56:38163Once it has been concluded that a protocol been proven adequate in
164production, and that it is deemed unlikely to receive any backward
165incompatible changes, it may be declared stable.
Simon Ser733de762019-11-21 11:25:00166
167The procedure of doing this is the following:
168
169- Create a new directory in the `stable/` toplevel directory with the
Jonas Ådahl5381e392020-11-18 15:56:38170 same name as the protocol directory in the `staging/` directory.
Simon Ser733de762019-11-21 11:25:00171- Copy the final version of the XML that is the version that was
172 decided to be declared stable into the new directory. The target name
173 should be the same name as the protocol directory but with the `.xml`
174 suffix.
Jonas Ådahl5381e392020-11-18 15:56:38175- Remove the disclaimer about the protocol being in the testing phase.
176- Update the `README` file in the staging directory and create a new
Simon Ser733de762019-11-21 11:25:00177 `README` file in the new directory.
Jonas Ådahl5381e392020-11-18 15:56:38178- Replace the disclaimer in the protocol files left in the staging/
179 directory with the following:
180
181```
182Disclaimer: This protocol extension has been marked stable. This copy is
183no longer used and only retained for backwards compatibility. The
184canonical version can be found in the stable/ directory.
185```
186
187Note that the major version of the stable protocol extension, as well as
188all the interface versions and names, must remain unchanged.
Simon Ser733de762019-11-21 11:25:00189
190There are other requirements for declaring a protocol stable, see
191[GOVERNANCE section 2.3](GOVERNANCE.md#23-introducing-new-protocols).
192
193## Releases
194
195Each release of wayland-protocols finalizes the version of the protocols
196to their state they had at that time.
Jonas Ådahl91bfada2020-04-28 09:05:27197
198## Gitlab conventions
199
200### Triaging merge requests
201
202New merge requests should be triaged. Doing so requires the one doing the
203triage to add a set of initial labels:
204
205~"New Protocol" - For a new protocol being added. If it's an amendment to
206an existing protocol, apply the label of the corresponding protocol
207instead. If none exist, create it.
208
209~"Needs acks" - If the protocol needs one or more acknowledgements.
210
211~"Needs implementations" - If there are not enough implementations of the
212protocol.
213
214~"Needs review" - If the protocol is in need of review.
215
216~"In 30 day discussion period" - If the protocol needs a 30 day discussion
217period.
218
219For the meaning and requirement of acknowledgments and available
220implementations, see the GOVERNANCE.md document.
221
222### Managing merge requests
223
224When merge requests get their needed feedback and items, remove the
225corresponding label that marks it as needing something. For example, if a
226merge request receives all the required acknowledgments, remove the ~"Needs
227acks" label, or if 30 days passed since opening, remove any ~"In 30 days
228discussion period" label.
229
230### Nacking a merge request
231
232If the inclusion of a merge request is denied due to one or more Nacks, add
233the ~Nacked label.