[RFC PATCH wayland-protocols] Introduce logical output protocol for Xwayland
ofourdan at redhat.com
Thu Jun 29 14:44:34 UTC 2017
This introduces a new protocol for the compositor to describe outputs
size in a logical way for Xwayland.
This is needed for X11 applications that would want to configure an X11
window based on the size of the output, without knowing the output scale
factor applied by the compositor to the corresponding Xwayland surface.
Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
Note: This is what Jonas called "wp_xwayland_configure_screen"
Makefile.am | 1 +
unstable/xwayland-logical-output/README | 5 +
.../xwayland-logical-output-unstable-v1.xml | 101 +++++++++++++++++++++
3 files changed, 107 insertions(+)
create mode 100644 unstable/xwayland-logical-output/README
create mode 100644 unstable/xwayland-logical-output/xwayland-logical-output-unstable-v1.xml
diff --git a/Makefile.am b/Makefile.am
index e693afa..e198362 100644
@@ -12,6 +12,7 @@ unstable_protocols = \
+ unstable/xwayland-logical-output/xwayland-logical-output-unstable-v1.xml \
stable_protocols = \
diff --git a/unstable/xwayland-logical-output/README b/unstable/xwayland-logical-output/README
new file mode 100644
@@ -0,0 +1,5 @@
+Xwayland logical output protocol
+Olivier Fourdan <ofourdan at redhat.com>
diff --git a/unstable/xwayland-logical-output/xwayland-logical-output-unstable-v1.xml b/unstable/xwayland-logical-output/xwayland-logical-output-unstable-v1.xml
new file mode 100644
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ Copyright © 2017 Red Hat Inc.
+ 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
+ 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.
+ <description summary="Protocol to describe logical output setup for Xwayland">
+ This optional protocol is application-specific to describe the logical
+ output setup for Xwayland. It provides a way for the compositor to
+ provide Xwayland with a specific pre-computed scaled size of the outputs.
+ The core Wayland interface wl_output lists all outputs and their
+ modes in hardware units along with the output scaling properties,
+ but Xwayland surfaces may be treated differently from regular Wayland
+ surfaces by the compositor, making it impossible for Xwayland to
+ reliably and consistently report all outputs to X11 clients via either
+ Xrandr or Xvidmode protocols based solely on the wl_output properties.
+ For example, for a compositor who does not scale Xwayland surfaces,
+ the reported output mode can match the hardware units, since the
+ requested size by X11 clients will match the actual size on the output,
+ but for another compositor who will scale the Xwayland surfaces, the
+ reported output size should be scaled down by the output scale factor
+ so that the resulting size matches the expected requested size by the
+ X11 client.
+ On top of that, some compositors implementing fractional scaling may
+ chose to report a larger scale factor via wl_output scale factor and
+ then scale the surface down to achieve the expected fractional scale.
+ This protocol specifies a way for the compositor to describe the output
+ size to Xwayland in a way that the X11 clients can use when requesting
+ a size or position.
+ Compositors are not required to implement this interface which remains
+ optional, however when implementing this interface, compositors are
+ required to restrict access to this application specific protocol to
+ Xwayland alone.
+ 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
+ <interface name="zwp_xwayland_logical_output" version="1">
+ <description summary="Compositor logical output region">
+ A zwp_xwayland_logical_output describes part of the output geometry
+ as exposed to X11 clients by Xwayland.
+ This typically corresponds to a monitor that displays part of the
+ compositor space in scaled units.
+ This object is published during start up, when a monitor is hot
+ plugged or when the logical (scaled) size of the output is changed.
+ <event name="geometry">
+ <description summary="Logical geometry of the output">
+ The geometry event describes the logical size of a wl_output.
+ This event is sent when binding to the xwl_logical_output object
+ and whenever the logical size changes.
+ <arg name="output" type="object" interface="wl_output"
+ summary="corresponding wl_output"/>
+ <arg name="width" type="int"
+ summary="width of the mode in logical (scaled) units"/>
+ <arg name="height" type="int"
+ summary="height of the mode in logical (scaled) units"/>
More information about the xorg-devel