mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-21 14:42:25 +00:00
output-power-management-v1: use enum_is_valid functions
Signed-off-by: xurui <xurui@kylinos.cn>
This commit is contained in:
parent
38fc4f2976
commit
3f314bc183
@ -77,11 +77,8 @@ static void output_power_handle_set_mode(struct wl_client *client,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (mode) {
|
uint32_t version = wl_resource_get_version(output_power_resource);
|
||||||
case ZWLR_OUTPUT_POWER_V1_MODE_OFF:
|
if (!zwlr_output_power_v1_mode_is_valid(mode, version)) {
|
||||||
case ZWLR_OUTPUT_POWER_V1_MODE_ON:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
wlr_log(WLR_ERROR, "Invalid power mode %d", mode);
|
wlr_log(WLR_ERROR, "Invalid power mode %d", mode);
|
||||||
wl_resource_post_error(output_power_resource,
|
wl_resource_post_error(output_power_resource,
|
||||||
ZWLR_OUTPUT_POWER_V1_ERROR_INVALID_MODE,
|
ZWLR_OUTPUT_POWER_V1_ERROR_INVALID_MODE,
|
||||||
|
Loading…
Reference in New Issue
Block a user