From 38fc4f2976df8083cf7c7e807351ce32e7a5b723 Mon Sep 17 00:00:00 2001 From: xurui Date: Wed, 23 Oct 2024 18:20:28 +0800 Subject: [PATCH] wlr_output_management_v1: use enum_is_valid functions Signed-off-by: xurui --- types/wlr_output_management_v1.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/wlr_output_management_v1.c b/types/wlr_output_management_v1.c index ecc32dede..551453e6b 100644 --- a/types/wlr_output_management_v1.c +++ b/types/wlr_output_management_v1.c @@ -255,8 +255,7 @@ static void config_head_handle_set_transform(struct wl_client *client, return; } - if (transform < WL_OUTPUT_TRANSFORM_NORMAL || - transform > WL_OUTPUT_TRANSFORM_FLIPPED_270) { + if (!wl_output_transform_is_valid(transform, 1)) { wl_resource_post_error(config_head_resource, ZWLR_OUTPUT_CONFIGURATION_HEAD_V1_ERROR_INVALID_TRANSFORM, "invalid transform");