<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 20, 2014 at 7:09 AM, Pekka Paalanen <span dir="ltr"><<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">From: Pekka Paalanen <<a href="mailto:pekka.paalanen@collabora.co.uk">pekka.paalanen@collabora.co.uk</a>><br>
<br>
Define what a role is, and what restrictions there are.<br>
<br>
A change to existing behaviour is that a role cannot be changed at all<br>
once set. However, this is unlikely to cause problems, as there is no<br>
reason to re-use wl_surfaces in clients.<br>
<br>
v2: give more concrete examples of roles, define losing a role, Jasper<br>
rewrote the paragraph on how a role is set.<br>
<br>
</div>v3: make role permanent, there is no such thing as "losing a role".<br>
Re-issuing the same role again must be allowed for wl_pointer.set_cursor<br>
et al. to work.<br>
<div class=""><br>
Signed-off-by: Pekka Paalanen <<a href="mailto:pekka.paalanen@collabora.co.uk">pekka.paalanen@collabora.co.uk</a>><br>
---<br>
</div> protocol/wayland.xml | 27 +++++++++++++++++++++++++--<br>
1 file changed, 25 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/protocol/wayland.xml b/protocol/wayland.xml<br>
index 2d57f69..7b05338 100644<br>
--- a/protocol/wayland.xml<br>
+++ b/protocol/wayland.xml<br>
@@ -973,8 +973,31 @@<br>
<div class=""> local coordinates of the pixel content, in case a buffer_transform<br>
or a buffer_scale is used.<br>
<br>
- Surfaces are also used for some special purposes, e.g. as<br>
- cursor images for pointers, drag icons, etc.<br>
+ A surface without a "role" is fairly useless, a compositor does<br>
+ not know where, when or how to present it. The role is the<br>
+ purpose of a wl_surface. Examples of roles are a cursor for a<br>
+ pointer (as set by wl_pointer.set_cursor), a drag icon<br>
+ (wl_data_device.start_drag), a sub-surface<br>
+ (wl_subcompositor.get_subsurface), and a window as defined by a<br>
+ shell protocol (e.g. wl_shell.get_shell_surface).<br>
+<br>
+ A surface can have only one role at a time. Initially a<br>
+ wl_surface does not have a role. Once a wl_surface is given a<br>
</div>+ role, it is set permanently for the whole lifetime of the<br>
+ wl_surface object. Giving the current role again is allowed,<br>
+ unless explicitly forbidden by the relevant interface<br>
+ specification.<br>
+<br>
+ Surface roles are given by requests in other interfaces such as<br>
<div class="">+ wl_pointer.set_cursor. The request should explicitly mention<br>
+ that this request gives a role to a wl_surface. Often, this<br>
+ request also creates a new protocol object that represents the<br>
+ role and adds additional functionality to wl_surface. When a<br>
+ client wants to destroy a wl_surface, they must destroy this 'role<br>
+ object' before the wl_surface.<br>
+<br>
</div>+ Destroying the role object does not remove the role from the<br>
+ wl_surface, but it may stop the wl_surface from playing the role.<br></blockquote><div><br></div><div>This is an odd expression to use. I'd put it in quotes, and give a few examples.<br><br></div><div>Destroying the role object does not remove the role from the wl_surface, but it may stop the wl_surface from "playing the role". For instance, destroying the wl_subsurface object will hide the subsurface, but the object will still have the subsurface role. To re-show the subsurface, a new wl_subsurface object may be created on the same wl_surface.<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"> </description><br>
<br>
<enum name="error"><br>
--<br>
1.8.5.5<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> Jasper<br>
</div></div>