summaryrefslogtreecommitdiff
path: root/README.md
blob: 1c46559ae26b92d3513f064c5ad4bed33af7c026 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# Wayland protocols

wayland-protocols contains Wayland protocols that add functionality not
available in the Wayland core protocol. Such protocols either add
completely new functionality, or extend the functionality of some other
protocol either in Wayland core, or some other protocol in
wayland-protocols.

A protocol in wayland-protocols consists of a directory containing a set
of XML files containing the protocol specification, and a README file
containing detailed state and a list of maintainers.

wayland-protocols is a standardization body formed of various Wayland
compositor and client developers. The governance rules are described in
[GOVERNANCE.md](GOVERNANCE.md) and the current members are listed in
[MEMBERS.md](MEMBERS.md).

## Protocol phases

Protocols in general have three phases: the development phase, the testing
phase, and the stable phase.

In the development phase, a protocol is not officially part of
wayland-protocols, but is actively being developed, for example by
iterating over it in a
[merge
request](https://gitlab.freedesktop.org/wayland/wayland-protocols/merge_requests),
or planning it in an
[issue](https://gitlab.freedesktop.org/wayland/wayland-protocols/issues).

During this phase, patches for clients and compositors are written as a test
vehicle. Such patches must not be merged in clients and compositors, because
the protocol can still change.

When a protocol has reached a stage where it is ready for wider adoption,
and after the [GOVERNANCE section
2.3](GOVERNANCE.md#2.3-introducing-new-protocols) requirements have been
met, it enters the "testing" phase. At this point, the protocol is added
to the `staging/` directory of wayland-protocols and made part of a release.
What this means is that implementation is encouraged in clients and
compositors where the functionality it specifies is wanted.

Extensions in staging cannot have backward incompatible changes, in that
sense they are equal to stable extensions. However, they may be completely
replaced with a new major version, or a different protocol extension altogether,
if design flaws are found in the testing phase.

After a staging protocol has been sufficiently tested in the wild and
proven adequate, its maintainers and the community at large may declare it
"stable", meaning it is unexpected to become superseded by a new major
version.

## Deprecation

A protocol may be deprecated, if it has been replaced by some other
protocol, or declared undesirable for some other reason. No more changes
will be made to a deprecated protocol.

## Legacy protocol phases

An "unstable" protocol refers to a protocol categorization policy
previously used by wayland-protocols, where protocols initially
placed in the `unstable/` directory had certain naming conventions were
applied, requiring a backward incompatible change to be declared "stable".

During this phase, protocol extension interface names were, in addition to
the major version postfix, also prefixed with `z` to distinguish them from
stable protocols.

## Protocol directory tree structure

Depending on which stage a protocol is in, the protocol is placed within
the toplevel directory containing the protocols with the same stage.
Stable protocols are placed in the `stable/` directory, staging protocols
are placed in the `staging/` directory, and deprecated protocols are
placed in the `deprecated/` directory.

Unstable protocols (see [Legacy protocol phases](#legacy-protocol-phases))
can be found in the `unstable/` directory, but new ones should never be
placed here.

## Protocol development procedure

To propose a new protocol, create a GitLab merge request adding the
relevant files and Makefile.am entry to the repository with the
explanation and motivation in the commit message. Protocols are
organized in namespaces describing their scope ("wp", "xdg" and "ext").
There are different requirements for each namespace, see [GOVERNANCE
section 2](GOVERNANCE.md#2-protocols) for more information.

If the new protocol is just an idea, open an issue on the GitLab issue
tracker. If the protocol isn't ready for complete review yet and is an
RFC, create a merge request and add the "WIP:" prefix in the title.

To propose changes to existing protocols, create a GitLab merge request.

Please include a `Signed-off-by` line at the end of the commit to certify
that you wrote it or otherwise have the right to pass it on as an
open-source patch. See the
[Developer Certificate of Origin](https://developercertificate.org/) for
a formal definition.

## Interface naming convention

All protocols should avoid using generic namespaces or no namespaces in
the protocol interface names in order to minimize risk that the generated
C API collides with other C API. Interface names that may collide with
interface names from other protocols should also be avoided.

For generic protocols not limited to certain configurations (such as
specific desktop environment or operating system) the `wp_` prefix
should be used on all interfaces in the protocol.

For protocols allowing clients to configure how their windows are
managed, the `xdg_` prefix should be used.

For operating system specific protocols, the interfaces should be
prefixed with both `wp_` and the operating system, for example
`wp_linux_`, or `wp_freebsd_`, etc.

For more information about namespaces, see [GOVERNANCE section 2.1
](GOVERNANCE.md#21-protocol-namespaces).

Each new protocol XML file must include a major version postfix, starting
with `-v1`. The purpose of this postfix is to make it possible to
distinguish between backward incompatible major versions of the same
protocol.

The interfaces in the protocol XML file should as well have the same
major version postfix in their names.

For example, the protocol `foo-bar` may have a XML file
`foo-bar/foo-bar-v1.xml`, consisting of the interface `wp_foo_bar_v1`,
corresponding to the major version 1, as well as the newer version
`foo-bar/foo-bar-v2.xml` consisting of the interface `wp_foo_bar_v2`,
corresponding to the major version 2.

## Include a disclaimer

Include the following disclaimer:

```
Warning! The protocol described in this file is currently in the testing
phase. Backward compatible changes may be added together with the
corresponding interface version bump. Backward incompatible changes can
only be done by creating a new major version of the extension.
```

## Use of RFC 2119 keywords

Descriptions of all new protocols must use (in lowercase) and adhere to the
proper meaning of the keywords described in
[RFC 2119](https://www.rfc-editor.org/info/rfc2119).

All protocol descriptions that follow the guidelines in RFC 2119 must
incorporate the following text in their toplevel protocol description section:

```
The key words "must", "must not", "required", "shall", "shall not", "should",
"should not", "recommended",  "may", and "optional" in this document are to
be interpreted as described in IETF RFC 2119.
```

Note that not all existing protocol descriptions conform to RFC 2119. Protocol
maintainers are encouraged to audit their descriptions, update them as needed
to follow RFC 2119 guidelines, and mark them as conformant in the way described
in the previous paragraph.

## Backward compatible protocol changes

A protocol may receive backward compatible additions and changes. This
is to be done in the general Wayland way, using `version` and `since` XML
element attributes.

## Backward incompatible protocol changes

While not preferred, a protocol may at any stage, especially during the
testing phase, when it is located in the `staging/` directory, see
backward incompatible changes.

Assuming a backward incompatible change is needed, the procedure for how to
do so is the following:

- Make a copy of the XML file with the major version increased by 1.
- Increase the major version number in the protocol XML by 1.
- Increase the major version number in all of the interfaces in the
  XML by 1.
- Reset the interface version number (interface version attribute) of all
  the interfaces to 1.
- Remove all of the `since` attributes.

## Declaring a protocol stable

Once it has been concluded that a protocol been proven adequate in
production, and that it is deemed unlikely to receive any backward
incompatible changes, it may be declared stable.

The procedure of doing this is the following:

- Create a new directory in the `stable/` toplevel directory with the
  same name as the protocol directory in the `staging/` directory.
- Copy the final version of the XML that is the version that was
  decided to be declared stable into the new directory. The target name
  should be the same name as the protocol directory plus the version and
  the `.xml` suffix.
- Remove the disclaimer about the protocol being in the testing phase.
- Update the `README` file in the staging directory and create a new
  `README` file in the new directory.
- Replace the disclaimer in the protocol files left in the staging/
  directory with the following:

```
Disclaimer: This protocol extension has been marked stable. This copy is
no longer used and only retained for backwards compatibility. The
canonical version can be found in the stable/ directory.
```

Note that the major version of the stable protocol extension, as well as
all the interface versions and names, must remain unchanged.

There are other requirements for declaring a protocol stable, see
[GOVERNANCE section 2.3](GOVERNANCE.md#23-introducing-new-protocols).

## Releases

Each release of wayland-protocols finalizes the version of the protocols
to their state they had at that time.

## Gitlab conventions

### Triaging merge requests

New merge requests should be triaged. Doing so requires the one doing the
triage to add a set of initial labels:

~"New Protocol" - For a new protocol being added. If it's an amendment to
an existing protocol, apply the label of the corresponding protocol
instead. If none exist, create it.

~"Needs acks" - If the protocol needs one or more acknowledgements.

~"Needs implementations" - If there are not enough implementations of the
protocol.

~"Needs review" - If the protocol is in need of review.

~"In 30 day discussion period" - If the protocol needs a 30 day discussion
period.

For the meaning and requirement of acknowledgments and available
implementations, see the [GOVERNANCE.md](GOVERNANCE.md) document.

### Managing merge requests

When merge requests get their needed feedback and items, remove the
corresponding label that marks it as needing something. For example, if a
merge request receives all the required acknowledgments, remove the
~"Needs acks" label, or if 30 days passed since opening, remove any
~"In 30 day discussion period" label.

### Nacking a merge request

If the inclusion of a merge request is denied due to one or more Nacks, add
the ~Nacked label.