diff options
author | Kirill Primak <vyivel@eclair.cafe> | 2022-09-17 10:16:07 +0300 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-09-17 08:20:24 +0000 |
commit | ebd4c83cd6699c606e57f141187984f0818a2973 (patch) | |
tree | 7d1ca6e950f892d429837eac41a5719eeb5ac478 | |
parent | 1465d238a497f07ee2f8d90b6a2c57a67e2e67ea (diff) |
xdg-toplevel: validate resize_edge
-rw-r--r-- | types/xdg_shell/wlr_xdg_toplevel.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/types/xdg_shell/wlr_xdg_toplevel.c b/types/xdg_shell/wlr_xdg_toplevel.c index 58acec27..f84f41af 100644 --- a/types/xdg_shell/wlr_xdg_toplevel.c +++ b/types/xdg_shell/wlr_xdg_toplevel.c @@ -285,6 +285,13 @@ static void xdg_toplevel_handle_resize(struct wl_client *client, struct wlr_seat_client *seat = wlr_seat_client_from_resource(seat_resource); + if (edges > XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_RIGHT) { + wl_resource_post_error(toplevel->base->resource, + XDG_TOPLEVEL_ERROR_INVALID_RESIZE_EDGE, + "provided value is not a valid variant of the resize_edge enum"); + return; + } + if (!toplevel->base->configured) { wl_resource_post_error(toplevel->base->resource, XDG_SURFACE_ERROR_NOT_CONSTRUCTED, |