wayland/pointer-constraints: Reject invalid lifetime

https://gitlab.gnome.org/GNOME/mutter/issues/425
This commit is contained in:
Vasilis Liaskovitis 2019-05-22 16:15:34 +02:00
parent deef9960a4
commit 7719e33e68

View File

@ -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,