mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-05-24 09:48:15 +02:00
virtual_keyboard_v1: validate keymap format
This commit is contained in:
parent
c5c1ba2baa
commit
91ef4ce208
2 changed files with 8 additions and 0 deletions
|
|
@ -47,6 +47,7 @@
|
|||
|
||||
<enum name="error">
|
||||
<entry name="no_keymap" value="0" summary="No keymap was set"/>
|
||||
<entry name="invalid_keymap_format" value="1" summary="Invalid keymap format"/>
|
||||
</enum>
|
||||
|
||||
<request name="key">
|
||||
|
|
|
|||
|
|
@ -44,6 +44,13 @@ static void virtual_keyboard_keymap(struct wl_client *client,
|
|||
return;
|
||||
}
|
||||
|
||||
if (!wl_keyboard_keymap_format_is_valid(format, 1)) {
|
||||
wl_resource_post_error(resource,
|
||||
ZWP_VIRTUAL_KEYBOARD_V1_ERROR_INVALID_KEYMAP_FORMAT,
|
||||
"Invalid keymap format");
|
||||
return;
|
||||
}
|
||||
|
||||
struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
|
||||
if (!context) {
|
||||
goto context_fail;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue