mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-22 07:02:28 +00:00
xdg-toplevel: use enum_is_valid functions
Signed-off-by: xurui <xurui@kylinos.cn>
This commit is contained in:
parent
c87ab6465d
commit
527b77b445
@ -297,18 +297,8 @@ static void xdg_toplevel_handle_resize(struct wl_client *client,
|
|||||||
struct wlr_seat_client *seat =
|
struct wlr_seat_client *seat =
|
||||||
wlr_seat_client_from_resource(seat_resource);
|
wlr_seat_client_from_resource(seat_resource);
|
||||||
|
|
||||||
switch (edges) {
|
uint32_t version = wl_resource_get_version(toplevel->base->resource);
|
||||||
case XDG_TOPLEVEL_RESIZE_EDGE_NONE:
|
if (!xdg_toplevel_resize_edge_is_valid(edges, version)) {
|
||||||
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,
|
wl_resource_post_error(toplevel->base->resource,
|
||||||
XDG_TOPLEVEL_ERROR_INVALID_RESIZE_EDGE,
|
XDG_TOPLEVEL_ERROR_INVALID_RESIZE_EDGE,
|
||||||
"provided value is not a valid variant of the resize_edge enum");
|
"provided value is not a valid variant of the resize_edge enum");
|
||||||
|
Loading…
Reference in New Issue
Block a user