mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-21 20:35:58 +01:00
xdg-shell: improve validation of resize edges
The current validation doesn't catch some invalid values such as 3 or 7.
This commit is contained in:
parent
97c8ad7c65
commit
5ae17de23f
1 changed files with 11 additions and 1 deletions
|
@ -313,7 +313,17 @@ 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) {
|
||||
switch (edges) {
|
||||
case XDG_TOPLEVEL_RESIZE_EDGE_TOP:
|
||||
case XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM:
|
||||
case XDG_TOPLEVEL_RESIZE_EDGE_LEFT:
|
||||
case XDG_TOPLEVEL_RESIZE_EDGE_RIGHT:
|
||||
case XDG_TOPLEVEL_RESIZE_EDGE_TOP_LEFT:
|
||||
case XDG_TOPLEVEL_RESIZE_EDGE_TOP_RIGHT:
|
||||
case XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_LEFT:
|
||||
case XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_RIGHT:
|
||||
break;
|
||||
default:
|
||||
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");
|
||||
|
|
Loading…
Reference in a new issue