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