mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-05-25 21:37:54 -04: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">
|
<enum name="error">
|
||||||
<entry name="no_keymap" value="0" summary="No keymap was set"/>
|
<entry name="no_keymap" value="0" summary="No keymap was set"/>
|
||||||
|
<entry name="invalid_keymap_format" value="1" summary="Invalid keymap format"/>
|
||||||
</enum>
|
</enum>
|
||||||
|
|
||||||
<request name="key">
|
<request name="key">
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,13 @@ static void virtual_keyboard_keymap(struct wl_client *client,
|
||||||
return;
|
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);
|
struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
|
||||||
if (!context) {
|
if (!context) {
|
||||||
goto context_fail;
|
goto context_fail;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue