summaryrefslogtreecommitdiff
path: root/stable
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2021-05-18 17:21:42 +0100
committerDaniel Stone <daniels@collabora.com>2021-07-21 13:07:59 +0000
commit11fecf0808602b0028122f11afb170ed36cec8dd (patch)
tree5787c7d2dfe4232c8f4bb0711b0fbdedf1c4a654 /stable
parent36cee4bdbcaf3a75f567315809953b5e21d703da (diff)
xdg-shell: Make xdg_surface fail when surface has role
It is illegal for a surface to have more than one role. The only thing which can be done with an xdg_surface (apart from destroying it) is to assign the surface a role with the get_toplevel, get_popup, etc requests. On Mutter, calling get_xdg_surface on a surface which already has an assigned role generates the 'role' protocol error. Weston will not send an error, however it may later abort on a failed assert during cleanup. wlroots allows this case, and only sends the role error when assigning an explicit role through creating a toplevel or popup. On the grounds that it makes no sense to create an xdg_surface for a wl_surface which already has a role, make it explicitly illegal. cf. wayland/weston!559, wayland/weston!627 Signed-off-by: Daniel Stone <daniels@collabora.com>
Diffstat (limited to 'stable')
-rw-r--r--stable/xdg-shell/xdg-shell.xml4
1 files changed, 3 insertions, 1 deletions
diff --git a/stable/xdg-shell/xdg-shell.xml b/stable/xdg-shell/xdg-shell.xml
index ae8ab67..364d130 100644
--- a/stable/xdg-shell/xdg-shell.xml
+++ b/stable/xdg-shell/xdg-shell.xml
@@ -75,7 +75,9 @@
<description summary="create a shell surface from a surface">
This creates an xdg_surface for the given surface. While xdg_surface
itself is not a role, the corresponding surface may only be assigned
- a role extending xdg_surface, such as xdg_toplevel or xdg_popup.
+ a role extending xdg_surface, such as xdg_toplevel or xdg_popup. It is
+ illegal to create an xdg_surface for a wl_surface which already has an
+ assigned role and this will result in a protocol error.
This creates an xdg_surface for the given surface. An xdg_surface is
used as basis to define a role to a given surface, such as xdg_toplevel