swc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/swc
Log | Files | Refs | README | LICENSE

commit 27d50e52dc4b86a064d534f4f5b3d142bfaebf00
parent e85a732295062164a890f85fabd3839510508131
Author: Michael Forney <mforney@mforney.org>
Date:   Sun, 12 Jan 2020 22:56:19 -0800

xdg_shell: Report error if surface already has role

Diffstat:
Mlibswc/xdg_shell.c | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/libswc/xdg_shell.c b/libswc/xdg_shell.c @@ -363,6 +363,10 @@ get_toplevel(struct wl_client *client, struct wl_resource *resource, uint32_t id struct xdg_surface *xdg_surface = wl_resource_get_user_data(resource); struct xdg_toplevel *toplevel; + if (xdg_surface->role) { + wl_resource_post_error(resource, XDG_WM_BASE_ERROR_ROLE, "surface already has a role"); + return; + } toplevel = xdg_toplevel_new(client, wl_resource_get_version(resource), id, xdg_surface); if (!toplevel) { wl_client_post_no_memory(client);