xdg-shell: Fail xdg_surface creation when surface has role
If a given wl_surface already has a role (e.g. cursor or subsurface), there is nothing you can do with an xdg_surface which won't raise an error, apart from destroying it. As of wayland/wayland-protocols@11fecf0808 this is now explicitly specified to be illegal, so disallow it within libweston-desktop. This avoids us tying ourselves in knots with surface-private ownership. Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
parent
baa8f6b1af
commit
80e9482292
@ -1422,6 +1422,13 @@ weston_desktop_xdg_shell_protocol_get_xdg_surface(struct wl_client *wl_client,
|
||||
wl_resource_get_user_data(surface_resource);
|
||||
struct weston_desktop_xdg_surface *surface;
|
||||
|
||||
if (wsurface->committed) {
|
||||
wl_resource_post_error(resource,
|
||||
XDG_WM_BASE_ERROR_ROLE,
|
||||
"xdg_surface must not have any other role");
|
||||
return;
|
||||
}
|
||||
|
||||
if (wsurface->buffer_ref.buffer != NULL) {
|
||||
wl_resource_post_error(resource,
|
||||
XDG_SURFACE_ERROR_UNCONFIGURED_BUFFER,
|
||||
|
Loading…
Reference in New Issue
Block a user