1*6c119a46SAndroid Build Coastguard Worker# Wayland protocols 2*6c119a46SAndroid Build Coastguard Worker 3*6c119a46SAndroid Build Coastguard Workerwayland-protocols contains Wayland protocols that add functionality not 4*6c119a46SAndroid Build Coastguard Workeravailable in the Wayland core protocol. Such protocols either add 5*6c119a46SAndroid Build Coastguard Workercompletely new functionality, or extend the functionality of some other 6*6c119a46SAndroid Build Coastguard Workerprotocol either in Wayland core, or some other protocol in 7*6c119a46SAndroid Build Coastguard Workerwayland-protocols. 8*6c119a46SAndroid Build Coastguard Worker 9*6c119a46SAndroid Build Coastguard WorkerA protocol in wayland-protocols consists of a directory containing a set 10*6c119a46SAndroid Build Coastguard Workerof XML files containing the protocol specification, and a README file 11*6c119a46SAndroid Build Coastguard Workercontaining detailed state and a list of maintainers. 12*6c119a46SAndroid Build Coastguard Worker 13*6c119a46SAndroid Build Coastguard Worker## Protocol phases 14*6c119a46SAndroid Build Coastguard Worker 15*6c119a46SAndroid Build Coastguard WorkerProtocols in general has three phases: the development phase, the testing 16*6c119a46SAndroid Build Coastguard Workerphase, and the stable phase. 17*6c119a46SAndroid Build Coastguard Worker 18*6c119a46SAndroid Build Coastguard WorkerIn the development phase, a protocol is not officially part of 19*6c119a46SAndroid Build Coastguard Workerwayland-protocols, but is actively being developed, for example by 20*6c119a46SAndroid Build Coastguard Workeriterating over it in a 21*6c119a46SAndroid Build Coastguard Worker[merge 22*6c119a46SAndroid Build Coastguard Workerrequest](https://gitlab.freedesktop.org/wayland/wayland-protocols/merge_requests), 23*6c119a46SAndroid Build Coastguard Workeror planning it in an 24*6c119a46SAndroid Build Coastguard Worker[issue](https://gitlab.freedesktop.org/wayland/wayland-protocols/issues). 25*6c119a46SAndroid Build Coastguard Worker 26*6c119a46SAndroid Build Coastguard WorkerDuring this phase, patches for clients and compositors are written as a test 27*6c119a46SAndroid Build Coastguard Workervehicle. Such patches must not be merged in clients and compositors, because 28*6c119a46SAndroid Build Coastguard Workerthe protocol can still change. 29*6c119a46SAndroid Build Coastguard Worker 30*6c119a46SAndroid Build Coastguard WorkerWhen a protocol has reached a stage where it is ready for wider adoption, 31*6c119a46SAndroid Build Coastguard Workerand after the [GOVERNANCE section 32*6c119a46SAndroid Build Coastguard Worker2.3](GOVERNANCE.md#2.3-introducing-new-protocols) requirements have been 33*6c119a46SAndroid Build Coastguard Workermet, it enters the "testing" phase. At this point, the protocol is added 34*6c119a46SAndroid Build Coastguard Workerto `staging/` directory of wayland-protocols and made part of a release. 35*6c119a46SAndroid Build Coastguard WorkerWhat this means is that implementation is encouraged in clients and 36*6c119a46SAndroid Build Coastguard Workercompositors where the functionality it specifies is wanted. 37*6c119a46SAndroid Build Coastguard Worker 38*6c119a46SAndroid Build Coastguard WorkerExtensions in staging cannot have backward incompatible changes, in that 39*6c119a46SAndroid Build Coastguard Workersense they are equal to stable extensions. However, they may be completely 40*6c119a46SAndroid Build Coastguard Workerreplaced with a new major version, or a different protocol extension all 41*6c119a46SAndroid Build Coastguard Workertogether, if design flaws are found in the testing phase. 42*6c119a46SAndroid Build Coastguard Worker 43*6c119a46SAndroid Build Coastguard WorkerAfter a staging protocol has been sufficiently tested in the wild and 44*6c119a46SAndroid Build Coastguard Workerproven adequate, its maintainers and the community at large may declare it 45*6c119a46SAndroid Build Coastguard Worker"stable", meaning it is unexpected to become superseded by a new major 46*6c119a46SAndroid Build Coastguard Workerversion. 47*6c119a46SAndroid Build Coastguard Worker 48*6c119a46SAndroid Build Coastguard Worker## Deprecation 49*6c119a46SAndroid Build Coastguard Worker 50*6c119a46SAndroid Build Coastguard WorkerA protocol may be deprecated, if it has been replaced by some other 51*6c119a46SAndroid Build Coastguard Workerprotocol, or declared undesirable for some other reason. No more changes 52*6c119a46SAndroid Build Coastguard Workerwill be made to a deprecated protocol. 53*6c119a46SAndroid Build Coastguard Worker 54*6c119a46SAndroid Build Coastguard Worker## Legacy protocol phases 55*6c119a46SAndroid Build Coastguard Worker 56*6c119a46SAndroid Build Coastguard WorkerAn "unstable" protocol refers to a protocol categorization policy 57*6c119a46SAndroid Build Coastguard Workerpreviously used by wayland-protocols, where protocols initially 58*6c119a46SAndroid Build Coastguard Workerplaced in the `unstable/` directory had certain naming conventions were 59*6c119a46SAndroid Build Coastguard Workerapplied, requiring a backward incompatible change to be declared "stable". 60*6c119a46SAndroid Build Coastguard Worker 61*6c119a46SAndroid Build Coastguard WorkerDuring this phase, protocol extension interface names were in addition to 62*6c119a46SAndroid Build Coastguard Workerthe major version postfix also prefixed with `z` to distinguish from 63*6c119a46SAndroid Build Coastguard Workerstable protocols. 64*6c119a46SAndroid Build Coastguard Worker 65*6c119a46SAndroid Build Coastguard Worker## Protocol directory tree structure 66*6c119a46SAndroid Build Coastguard Worker 67*6c119a46SAndroid Build Coastguard WorkerDepending on which stage a protocol is in, the protocol is placed within 68*6c119a46SAndroid Build Coastguard Workerthe toplevel directory containing the protocols with the same stage. 69*6c119a46SAndroid Build Coastguard WorkerStable protocols are placed in the `stable/` directory, staging protocols 70*6c119a46SAndroid Build Coastguard Workerare placed in the `staging/` directory, and deprecated protocols are 71*6c119a46SAndroid Build Coastguard Workerplaced in the `deprecated/` directory. 72*6c119a46SAndroid Build Coastguard Worker 73*6c119a46SAndroid Build Coastguard WorkerUnstable protocols (see [Legacy protocol phases](#legacy-protocol-phases)) 74*6c119a46SAndroid Build Coastguard Workercan be found in the `unstable/` directory, but new ones should never be 75*6c119a46SAndroid Build Coastguard Workerplaced here. 76*6c119a46SAndroid Build Coastguard Worker 77*6c119a46SAndroid Build Coastguard Worker## Protocol development procedure 78*6c119a46SAndroid Build Coastguard Worker 79*6c119a46SAndroid Build Coastguard WorkerTo propose a new protocol, create a GitLab merge request adding the 80*6c119a46SAndroid Build Coastguard Workerrelevant files and Makefile.am entry to the repository with the 81*6c119a46SAndroid Build Coastguard Workerexplanation and motivation in the commit message. Protocols are 82*6c119a46SAndroid Build Coastguard Workerorganized in namespaces describing their scope ("wp", "xdg" and "ext"). 83*6c119a46SAndroid Build Coastguard WorkerThere are different requirements for each namespace, see [GOVERNANCE 84*6c119a46SAndroid Build Coastguard Workersection 2](GOVERNANCE.md#2-protocols) for more information. 85*6c119a46SAndroid Build Coastguard Worker 86*6c119a46SAndroid Build Coastguard WorkerIf the new protocol is just an idea, open an issue on the GitLab issue 87*6c119a46SAndroid Build Coastguard Workertracker. If the protocol isn't ready for complete review yet and is an 88*6c119a46SAndroid Build Coastguard WorkerRFC, create a merge request and add the "WIP:" prefix in the title. 89*6c119a46SAndroid Build Coastguard Worker 90*6c119a46SAndroid Build Coastguard WorkerTo propose changes to existing protocols, create a GitLab merge request. 91*6c119a46SAndroid Build Coastguard Worker 92*6c119a46SAndroid Build Coastguard WorkerPlease include a `Signed-off-by` line at the end of the commit to certify 93*6c119a46SAndroid Build Coastguard Workerthat you wrote it or otherwise have the right to pass it on as an 94*6c119a46SAndroid Build Coastguard Workeropen-source patch. See the 95*6c119a46SAndroid Build Coastguard Worker[Developer Certificate of Origin](https://developercertificate.org/) for 96*6c119a46SAndroid Build Coastguard Workera formal definition. 97*6c119a46SAndroid Build Coastguard Worker 98*6c119a46SAndroid Build Coastguard Worker## Interface naming convention 99*6c119a46SAndroid Build Coastguard Worker 100*6c119a46SAndroid Build Coastguard WorkerAll protocols should avoid using generic namespaces or no namespaces in 101*6c119a46SAndroid Build Coastguard Workerthe protocol interface names in order to minimize risk that the generated 102*6c119a46SAndroid Build Coastguard WorkerC API collides with other C API. Interface names that may collide with 103*6c119a46SAndroid Build Coastguard Workerinterface names from other protocols should also be avoided. 104*6c119a46SAndroid Build Coastguard Worker 105*6c119a46SAndroid Build Coastguard WorkerFor generic protocols not limited to certain configurations (such as 106*6c119a46SAndroid Build Coastguard Workerspecific desktop environment or operating system) the `wp_` prefix 107*6c119a46SAndroid Build Coastguard Workershould be used on all interfaces in the protocol. 108*6c119a46SAndroid Build Coastguard Worker 109*6c119a46SAndroid Build Coastguard WorkerFor protocols allowing clients to configure how their windows are 110*6c119a46SAndroid Build Coastguard Workermanaged, the `xdg_` prefix should be used. 111*6c119a46SAndroid Build Coastguard Worker 112*6c119a46SAndroid Build Coastguard WorkerFor operating system specific protocols, the interfaces should be 113*6c119a46SAndroid Build Coastguard Workerprefixed with both `wp_` and the operating system, for example 114*6c119a46SAndroid Build Coastguard Worker`wp_linux_`, or `wp_freebsd_`, etc. 115*6c119a46SAndroid Build Coastguard Worker 116*6c119a46SAndroid Build Coastguard WorkerFor more information about namespaces, see [GOVERNANCE section 2.1 117*6c119a46SAndroid Build Coastguard Worker](GOVERNANCE.md#21-protocol-namespaces). 118*6c119a46SAndroid Build Coastguard Worker 119*6c119a46SAndroid Build Coastguard WorkerEach new protocol XML file must include a major version postfix, starting 120*6c119a46SAndroid Build Coastguard Workerwith `-v1`. The purpose of this postfix is to make it possible to 121*6c119a46SAndroid Build Coastguard Workerdistinguish between backward incompatible major versions of the same 122*6c119a46SAndroid Build Coastguard Workerprotocol. 123*6c119a46SAndroid Build Coastguard Worker 124*6c119a46SAndroid Build Coastguard WorkerThe interfaces in the protocol XML file should as well have the same 125*6c119a46SAndroid Build Coastguard Workermajor version postfix in their names. 126*6c119a46SAndroid Build Coastguard Worker 127*6c119a46SAndroid Build Coastguard WorkerFor example, the protocol `foo-bar` may have a XML file 128*6c119a46SAndroid Build Coastguard Worker`foo-bar/foo-bar-v1.xml`, consisting of the interface `wp_foo_bar_v1`, 129*6c119a46SAndroid Build Coastguard Workercorresponding to the major version 1, as well as the newer version 130*6c119a46SAndroid Build Coastguard Worker`foo-bar/foo-bar-v2.xml` consisting of the interface `wp_foo_bar_v2`, 131*6c119a46SAndroid Build Coastguard Workercorresponding to the major version 2. 132*6c119a46SAndroid Build Coastguard Worker 133*6c119a46SAndroid Build Coastguard Worker## Include a disclaimer 134*6c119a46SAndroid Build Coastguard Worker 135*6c119a46SAndroid Build Coastguard WorkerInclude the following disclaimer: 136*6c119a46SAndroid Build Coastguard Worker 137*6c119a46SAndroid Build Coastguard Worker``` 138*6c119a46SAndroid Build Coastguard WorkerWarning! The protocol described in this file is currently in the testing 139*6c119a46SAndroid Build Coastguard Workerphase. Backward compatible changes may be added together with the 140*6c119a46SAndroid Build Coastguard Workercorresponding interface version bump. Backward incompatible changes can 141*6c119a46SAndroid Build Coastguard Workeronly be done by creating a new major version of the extension. 142*6c119a46SAndroid Build Coastguard Worker``` 143*6c119a46SAndroid Build Coastguard Worker 144*6c119a46SAndroid Build Coastguard Worker## Backward compatible protocol changes 145*6c119a46SAndroid Build Coastguard Worker 146*6c119a46SAndroid Build Coastguard WorkerA protocol may receive backward compatible additions and changes. This 147*6c119a46SAndroid Build Coastguard Workeris to be done in the general Wayland way, using `version` and `since` XML 148*6c119a46SAndroid Build Coastguard Workerelement attributes. 149*6c119a46SAndroid Build Coastguard Worker 150*6c119a46SAndroid Build Coastguard Worker## Backward incompatible protocol changes 151*6c119a46SAndroid Build Coastguard Worker 152*6c119a46SAndroid Build Coastguard WorkerWhile not preferred, a protocol may at any stage, especially during the 153*6c119a46SAndroid Build Coastguard Workertesting phase, when it is located in the `staging/` directory, see 154*6c119a46SAndroid Build Coastguard Workerbackward incompatible changes. 155*6c119a46SAndroid Build Coastguard Worker 156*6c119a46SAndroid Build Coastguard WorkerAssuming a backward incompatible change is needed, the procedure for how to 157*6c119a46SAndroid Build Coastguard Workerdo so is the following: 158*6c119a46SAndroid Build Coastguard Worker 159*6c119a46SAndroid Build Coastguard Worker- Make a copy of the XML file with the major version increased by 1. 160*6c119a46SAndroid Build Coastguard Worker- Increase the major version number in the protocol XML by 1. 161*6c119a46SAndroid Build Coastguard Worker- Increase the major version number in all of the interfaces in the 162*6c119a46SAndroid Build Coastguard Worker XML by 1. 163*6c119a46SAndroid Build Coastguard Worker- Reset the interface version number (interface version attribute) of all 164*6c119a46SAndroid Build Coastguard Worker the interfaces to 1. 165*6c119a46SAndroid Build Coastguard Worker- Remove all of the `since` attributes. 166*6c119a46SAndroid Build Coastguard Worker 167*6c119a46SAndroid Build Coastguard Worker## Declaring a protocol stable 168*6c119a46SAndroid Build Coastguard Worker 169*6c119a46SAndroid Build Coastguard WorkerOnce it has been concluded that a protocol been proven adequate in 170*6c119a46SAndroid Build Coastguard Workerproduction, and that it is deemed unlikely to receive any backward 171*6c119a46SAndroid Build Coastguard Workerincompatible changes, it may be declared stable. 172*6c119a46SAndroid Build Coastguard Worker 173*6c119a46SAndroid Build Coastguard WorkerThe procedure of doing this is the following: 174*6c119a46SAndroid Build Coastguard Worker 175*6c119a46SAndroid Build Coastguard Worker- Create a new directory in the `stable/` toplevel directory with the 176*6c119a46SAndroid Build Coastguard Worker same name as the protocol directory in the `staging/` directory. 177*6c119a46SAndroid Build Coastguard Worker- Copy the final version of the XML that is the version that was 178*6c119a46SAndroid Build Coastguard Worker decided to be declared stable into the new directory. The target name 179*6c119a46SAndroid Build Coastguard Worker should be the same name as the protocol directory but with the `.xml` 180*6c119a46SAndroid Build Coastguard Worker suffix. 181*6c119a46SAndroid Build Coastguard Worker- Remove the disclaimer about the protocol being in the testing phase. 182*6c119a46SAndroid Build Coastguard Worker- Update the `README` file in the staging directory and create a new 183*6c119a46SAndroid Build Coastguard Worker `README` file in the new directory. 184*6c119a46SAndroid Build Coastguard Worker- Replace the disclaimer in the protocol files left in the staging/ 185*6c119a46SAndroid Build Coastguard Worker directory with the following: 186*6c119a46SAndroid Build Coastguard Worker 187*6c119a46SAndroid Build Coastguard Worker``` 188*6c119a46SAndroid Build Coastguard WorkerDisclaimer: This protocol extension has been marked stable. This copy is 189*6c119a46SAndroid Build Coastguard Workerno longer used and only retained for backwards compatibility. The 190*6c119a46SAndroid Build Coastguard Workercanonical version can be found in the stable/ directory. 191*6c119a46SAndroid Build Coastguard Worker``` 192*6c119a46SAndroid Build Coastguard Worker 193*6c119a46SAndroid Build Coastguard WorkerNote that the major version of the stable protocol extension, as well as 194*6c119a46SAndroid Build Coastguard Workerall the interface versions and names, must remain unchanged. 195*6c119a46SAndroid Build Coastguard Worker 196*6c119a46SAndroid Build Coastguard WorkerThere are other requirements for declaring a protocol stable, see 197*6c119a46SAndroid Build Coastguard Worker[GOVERNANCE section 2.3](GOVERNANCE.md#23-introducing-new-protocols). 198*6c119a46SAndroid Build Coastguard Worker 199*6c119a46SAndroid Build Coastguard Worker## Releases 200*6c119a46SAndroid Build Coastguard Worker 201*6c119a46SAndroid Build Coastguard WorkerEach release of wayland-protocols finalizes the version of the protocols 202*6c119a46SAndroid Build Coastguard Workerto their state they had at that time. 203*6c119a46SAndroid Build Coastguard Worker 204*6c119a46SAndroid Build Coastguard Worker## Gitlab conventions 205*6c119a46SAndroid Build Coastguard Worker 206*6c119a46SAndroid Build Coastguard Worker### Triaging merge requests 207*6c119a46SAndroid Build Coastguard Worker 208*6c119a46SAndroid Build Coastguard WorkerNew merge requests should be triaged. Doing so requires the one doing the 209*6c119a46SAndroid Build Coastguard Workertriage to add a set of initial labels: 210*6c119a46SAndroid Build Coastguard Worker 211*6c119a46SAndroid Build Coastguard Worker~"New Protocol" - For a new protocol being added. If it's an amendment to 212*6c119a46SAndroid Build Coastguard Workeran existing protocol, apply the label of the corresponding protocol 213*6c119a46SAndroid Build Coastguard Workerinstead. If none exist, create it. 214*6c119a46SAndroid Build Coastguard Worker 215*6c119a46SAndroid Build Coastguard Worker~"Needs acks" - If the protocol needs one or more acknowledgements. 216*6c119a46SAndroid Build Coastguard Worker 217*6c119a46SAndroid Build Coastguard Worker~"Needs implementations" - If there are not enough implementations of the 218*6c119a46SAndroid Build Coastguard Workerprotocol. 219*6c119a46SAndroid Build Coastguard Worker 220*6c119a46SAndroid Build Coastguard Worker~"Needs review" - If the protocol is in need of review. 221*6c119a46SAndroid Build Coastguard Worker 222*6c119a46SAndroid Build Coastguard Worker~"In 30 day discussion period" - If the protocol needs a 30 day discussion 223*6c119a46SAndroid Build Coastguard Workerperiod. 224*6c119a46SAndroid Build Coastguard Worker 225*6c119a46SAndroid Build Coastguard WorkerFor the meaning and requirement of acknowledgments and available 226*6c119a46SAndroid Build Coastguard Workerimplementations, see the GOVERNANCE.md document. 227*6c119a46SAndroid Build Coastguard Worker 228*6c119a46SAndroid Build Coastguard Worker### Managing merge requests 229*6c119a46SAndroid Build Coastguard Worker 230*6c119a46SAndroid Build Coastguard WorkerWhen merge requests get their needed feedback and items, remove the 231*6c119a46SAndroid Build Coastguard Workercorresponding label that marks it as needing something. For example, if a 232*6c119a46SAndroid Build Coastguard Workermerge request receives all the required acknowledgments, remove the 233*6c119a46SAndroid Build Coastguard Worker~"Needs acks" label, or if 30 days passed since opening, remove any 234*6c119a46SAndroid Build Coastguard Worker~"In 30 day discussion period" label. 235*6c119a46SAndroid Build Coastguard Worker 236*6c119a46SAndroid Build Coastguard Worker### Nacking a merge request 237*6c119a46SAndroid Build Coastguard Worker 238*6c119a46SAndroid Build Coastguard WorkerIf the inclusion of a merge request is denied due to one or more Nacks, add 239*6c119a46SAndroid Build Coastguard Workerthe ~Nacked label. 240