diff --git a/src/wayland/meta-wayland-pointer-constraints.c b/src/wayland/meta-wayland-pointer-constraints.c index a33b672f1..aa59dbcb4 100644 --- a/src/wayland/meta-wayland-pointer-constraints.c +++ b/src/wayland/meta-wayland-pointer-constraints.c @@ -862,6 +862,19 @@ init_pointer_constraint (struct wl_resource *resource, return; } + switch (lifetime) + { + case ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT: + case ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT: + break; + + default: + wl_resource_post_error (resource, + WL_DISPLAY_ERROR_INVALID_OBJECT, + "Invalid constraint lifetime"); + return; + } + constraint = meta_wayland_pointer_constraint_new (surface, seat, region, lifetime,