summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-03-28 19:58:04 +0200
committerSimon Ser <contact@emersion.fr>2023-02-07 14:33:09 +0100
commit9afab91d212164b56c7eefd234c798fc59ae3fd8 (patch)
tree02dbaf1c74864158de7e2f8cc6e7ce8030aea617
parent83e9c9e117acdf104a9d33838d99a4025a647dfe (diff)
downloadwayland-9afab91d212164b56c7eefd234c798fc59ae3fd8.tar.gz
protocol: add wl_surface.preferred_buffer_scale
Right now, clients need to bind to wl_output globals, listen to wl_output.scale, listen to wl_surface.enter/leave, pick the highest scale factor. This is an issue because it breaks Wayland's "policy, not mechanism" motto. Clients take the decision of which scale to use depending on the outputs they're on, compositors have no say in this (apart from faking output events, which isn't great). This commit introduces a new wl_surface.preferred_buffer_scale event to allow compositors to directly indicate the preferred scale factor for each surface. This unlocks features which require dynamically changing the scale such as: - Accessibility features such as screen magnifier - In a VR environment, render surfaces close to the eye at a higher scale - HiDPI screenshots on LoDPI screens Signed-off-by: Simon Ser <contact@emersion.fr> Closes: https://gitlab.freedesktop.org/wayland/wayland/-/issues/271
-rw-r--r--protocol/wayland.xml19
1 files changed, 17 insertions, 2 deletions
diff --git a/protocol/wayland.xml b/protocol/wayland.xml
index 6702bed..c0816f6 100644
--- a/protocol/wayland.xml
+++ b/protocol/wayland.xml
@@ -190,7 +190,7 @@
</event>
</interface>
- <interface name="wl_compositor" version="5">
+ <interface name="wl_compositor" version="6">
<description summary="the compositor singleton">
A compositor. This object is a singleton global. The
compositor is in charge of combining the contents of multiple
@@ -1358,7 +1358,7 @@
</event>
</interface>
- <interface name="wl_surface" version="5">
+ <interface name="wl_surface" version="6">
<description summary="an onscreen surface">
A surface is a rectangular area that may be displayed on zero
or more outputs, and shown any number of times at the compositor's
@@ -1795,6 +1795,21 @@
<arg name="x" type="int" summary="surface-local x coordinate"/>
<arg name="y" type="int" summary="surface-local y coordinate"/>
</request>
+
+ <!-- Version 6 additions -->
+
+ <event name="preferred_buffer_scale" since="6">
+ <description summary="preferred buffer scale for the surface">
+ This event indicates the preferred buffer scale for this surface. It is
+ sent whenever the compositor's preference changes.
+
+ It is intended that scaling aware clients use this event to scale their
+ content and use wl_surface.set_buffer_scale to indicate the scale they
+ have rendered with. This allows clients to supply a higher detail
+ buffer.
+ </description>
+ <arg name="factor" type="int" summary="preferred scaling factor"/>
+ </event>
</interface>
<interface name="wl_seat" version="8">