protocol: Add wl_surface.offset
This is meant to address the issue where the call to 'wl_surface.attach' is done by e.g. Vulkan, meaning applications cannot affect the values of the offset passed as the x and y arguments. The lack of ability to pass these is problematic when using the Vulkan for e.g. drawing DND surfaces, as the buffer offset is used to implement the drag icon hotspots. Closes: https://gitlab.freedesktop.org/wayland/wayland/-/issues/148 Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
parent
f00cfda737
commit
fceabb7e9e
|
@ -35,6 +35,20 @@
|
||||||
#include "wayland-util.h"
|
#include "wayland-util.h"
|
||||||
|
|
||||||
|
|
||||||
|
/** Resize the EGL window
|
||||||
|
*
|
||||||
|
* \param egl_window A pointer to a struct wl_egl_window
|
||||||
|
* \param width The new width
|
||||||
|
* \param height The new height
|
||||||
|
* \param dx Offset on the X axis
|
||||||
|
* \param dy Offset on the Y axis
|
||||||
|
*
|
||||||
|
* Note that applications should prefer using the wl_surface.offset request if
|
||||||
|
* the associated wl_surface has the interface version 5 or higher.
|
||||||
|
*
|
||||||
|
* If the wl_surface.offset request is used, applications MUST pass 0 to both
|
||||||
|
* dx and dy.
|
||||||
|
*/
|
||||||
WL_EXPORT void
|
WL_EXPORT void
|
||||||
wl_egl_window_resize(struct wl_egl_window *egl_window,
|
wl_egl_window_resize(struct wl_egl_window *egl_window,
|
||||||
int width, int height,
|
int width, int height,
|
||||||
|
|
|
@ -187,7 +187,7 @@
|
||||||
</event>
|
</event>
|
||||||
</interface>
|
</interface>
|
||||||
|
|
||||||
<interface name="wl_compositor" version="4">
|
<interface name="wl_compositor" version="5">
|
||||||
<description summary="the compositor singleton">
|
<description summary="the compositor singleton">
|
||||||
A compositor. This object is a singleton global. The
|
A compositor. This object is a singleton global. The
|
||||||
compositor is in charge of combining the contents of multiple
|
compositor is in charge of combining the contents of multiple
|
||||||
|
@ -1337,7 +1337,7 @@
|
||||||
</event>
|
</event>
|
||||||
</interface>
|
</interface>
|
||||||
|
|
||||||
<interface name="wl_surface" version="4">
|
<interface name="wl_surface" version="5">
|
||||||
<description summary="an onscreen surface">
|
<description summary="an onscreen surface">
|
||||||
A surface is a rectangular area that may be displayed on zero
|
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
|
or more outputs, and shown any number of times at the compositor's
|
||||||
|
@ -1389,6 +1389,7 @@
|
||||||
<entry name="invalid_scale" value="0" summary="buffer scale value is invalid"/>
|
<entry name="invalid_scale" value="0" summary="buffer scale value is invalid"/>
|
||||||
<entry name="invalid_transform" value="1" summary="buffer transform value is invalid"/>
|
<entry name="invalid_transform" value="1" summary="buffer transform value is invalid"/>
|
||||||
<entry name="invalid_size" value="2" summary="buffer size is invalid"/>
|
<entry name="invalid_size" value="2" summary="buffer size is invalid"/>
|
||||||
|
<entry name="invalid_offset" value="3" summary="buffer offset is invalid"/>
|
||||||
</enum>
|
</enum>
|
||||||
|
|
||||||
<request name="destroy" type="destructor">
|
<request name="destroy" type="destructor">
|
||||||
|
@ -1411,7 +1412,14 @@
|
||||||
buffer's upper left corner, relative to the current buffer's upper
|
buffer's upper left corner, relative to the current buffer's upper
|
||||||
left corner, in surface-local coordinates. In other words, the
|
left corner, in surface-local coordinates. In other words, the
|
||||||
x and y, combined with the new surface size define in which
|
x and y, combined with the new surface size define in which
|
||||||
directions the surface's size changes.
|
directions the surface's size changes. Setting anything other than 0
|
||||||
|
as x and y arguments is discouraged, and should instead be replaced
|
||||||
|
with using the separate wl_surface.offset request.
|
||||||
|
|
||||||
|
When the bound wl_surface version is 5 or higher, passing any
|
||||||
|
non-zero x or y is a protocol violation, and will result in an
|
||||||
|
'invalid_offset' error being raised. To achieve equivalent semantics,
|
||||||
|
use wl_surface.offset.
|
||||||
|
|
||||||
Surface contents are double-buffered state, see wl_surface.commit.
|
Surface contents are double-buffered state, see wl_surface.commit.
|
||||||
|
|
||||||
|
@ -1742,6 +1750,27 @@
|
||||||
<arg name="width" type="int" summary="width of damage rectangle"/>
|
<arg name="width" type="int" summary="width of damage rectangle"/>
|
||||||
<arg name="height" type="int" summary="height of damage rectangle"/>
|
<arg name="height" type="int" summary="height of damage rectangle"/>
|
||||||
</request>
|
</request>
|
||||||
|
|
||||||
|
<!-- Version 5 additions -->
|
||||||
|
|
||||||
|
<request name="offset" since="5">
|
||||||
|
<description summary="set the surface contents offset">
|
||||||
|
The x and y arguments specify the location of the new pending
|
||||||
|
buffer's upper left corner, relative to the current buffer's upper
|
||||||
|
left corner, in surface-local coordinates. In other words, the
|
||||||
|
x and y, combined with the new surface size define in which
|
||||||
|
directions the surface's size changes.
|
||||||
|
|
||||||
|
Surface location offset is double-buffered state, see
|
||||||
|
wl_surface.commit.
|
||||||
|
|
||||||
|
This request is semantically equivalent to and the replaces the x and y
|
||||||
|
arguments in the wl_surface.attach request in wl_surface versions prior
|
||||||
|
to 5. See wl_surface.attach for details.
|
||||||
|
</description>
|
||||||
|
<arg name="x" type="int" summary="surface-local x coordinate"/>
|
||||||
|
<arg name="y" type="int" summary="surface-local y coordinate"/>
|
||||||
|
</request>
|
||||||
</interface>
|
</interface>
|
||||||
|
|
||||||
<interface name="wl_seat" version="7">
|
<interface name="wl_seat" version="7">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user