commit 27d50e5
Michael Forney
·
2020-01-13 06:56:19 +0000 UTC
parent e85a732
xdg_shell: Report error if surface already has role
1 files changed,
+4,
-0
+4,
-0
1@@ -363,6 +363,10 @@ get_toplevel(struct wl_client *client, struct wl_resource *resource, uint32_t id
2 struct xdg_surface *xdg_surface = wl_resource_get_user_data(resource);
3 struct xdg_toplevel *toplevel;
4
5+ if (xdg_surface->role) {
6+ wl_resource_post_error(resource, XDG_WM_BASE_ERROR_ROLE, "surface already has a role");
7+ return;
8+ }
9 toplevel = xdg_toplevel_new(client, wl_resource_get_version(resource), id, xdg_surface);
10 if (!toplevel) {
11 wl_client_post_no_memory(client);