From 76d1ae8c65739eff3434ef219c58a913ad34e988 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 18 Jun 2018 06:16:21 -0400 Subject: unstable: add xdg-decoration protocol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds a new protocol to negotiate server-side rendering of window decorations for xdg-toplevels. This allows compositors that want to draw decorations themselves to send their preference to clients, and clients that prefer server-side decorations to request them. This is inspired by a protocol from KDE [1] which has been implemented in KDE and Sway and was submitted for consideration in 2017 [2]. This patch provides an updated protocol with those concerns taken into account. Signed-off-by: Simon Ser Reviewed-by: Drew DeVault Reviewed-by: David Edmundson Reviewed-by: Eike Hein Reviewed-by: Alan Griffiths Reviewed-by: Jonas Ådahl [1] https://github.com/KDE/kwayland/blob/master/src/client/protocols/server-decoration.xml [2] https://lists.freedesktop.org/archives/wayland-devel/2017-October/035564.html --- unstable/xdg-decoration/README | 4 + .../xdg-decoration/xdg-decoration-unstable-v1.xml | 156 +++++++++++++++++++++ 2 files changed, 160 insertions(+) create mode 100644 unstable/xdg-decoration/README create mode 100644 unstable/xdg-decoration/xdg-decoration-unstable-v1.xml (limited to 'unstable') diff --git a/unstable/xdg-decoration/README b/unstable/xdg-decoration/README new file mode 100644 index 0000000..73f0c52 --- /dev/null +++ b/unstable/xdg-decoration/README @@ -0,0 +1,4 @@ +xdg_decoration protocol + +Maintainers: +Simon Ser diff --git a/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml b/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml new file mode 100644 index 0000000..378e8ff --- /dev/null +++ b/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml @@ -0,0 +1,156 @@ + + + + Copyright © 2018 Simon Ser + + 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. + + + + + This interface allows a compositor to announce support for server-side + decorations. + + A window decoration is a set of window controls as deemed appropriate by + the party managing them, such as user interface components used to move, + resize and change a window's state. + + A client can use this protocol to request being decorated by a supporting + compositor. + + If compositor and client do not negotiate the use of a server-side + decoration using this protocol, clients continue to self-decorate as they + see fit. + + Warning! The protocol described in this file is experimental and + backward incompatible changes may be made. Backward compatible changes + may be added together with the corresponding interface version bump. + Backward incompatible changes are done by bumping the version number in + the protocol and interface names and resetting the interface version. + Once the protocol is to be declared stable, the 'z' prefix and the + version number in the protocol and interface names are removed and the + interface version number is reset. + + + + + Destroy the decoration manager. This doesn't destroy objects created + with the manager. + + + + + + Create a new decoration object associated with the given toplevel. + + Creating an xdg_toplevel_decoration from an xdg_toplevel which has a + buffer attached or committed is a client error, and any attempts by a + client to attach or manipulate a buffer prior to the first + xdg_toplevel_decoration.configure event must also be treated as + errors. + + + + + + + + + The decoration object allows the compositor to toggle server-side window + decorations for a toplevel surface. The client can request to switch to + another mode. + + The xdg_toplevel_decoration object must be destroyed before its + xdg_toplevel. + + + + + + + + + + + Switch back to a mode without any server-side decorations at the next + commit. + + + + + + These values describe window decoration modes. + + + + + + + + Set the toplevel surface decoration mode. This informs the compositor + that the client prefers the provided decoration mode. + + After requesting a decoration mode, the compositor will respond by + emitting a xdg_surface.configure event. The client should then update + its content, drawing it without decorations if the received mode is + server-side decorations. The client must also acknowledge the configure + when committing the new content (see xdg_surface.ack_configure). + + The compositor can decide not to use the client's mode and enforce a + different mode instead. + + Clients whose decoration mode depend on the xdg_toplevel state may send + a set_mode request in response to a xdg_surface.configure event and wait + for the next xdg_surface.configure event to prevent unwanted state. + Such clients are responsible for preventing configure loops and must + make sure not to send multiple successive set_mode requests with the + same decoration mode. + + + + + + + Unset the toplevel surface decoration mode. This informs the compositor + that the client doesn't prefer a particular decoration mode. + + This request has the same semantics as set_mode. + + + + + + The configure event asks the client to change its decoration mode. The + configured state should not be applied immediately. Clients must send an + ack_configure in response to this event. See xdg_surface.configure and + xdg_surface.ack_configure for details. + + A configure event can be sent at any time. The specified mode must be + obeyed by the client. + + + + + -- cgit v1.2.3