virtual-keyboard: add wlr_virtual_keyboard_v1_from_resource()

I want to use the zwp_virtual_keyboard_v1 object in a custom river
protocol and need to be able to obtain the corresponding wlroots struct.
This commit is contained in:
Isaac Freund 2026-03-17 09:29:21 +01:00 committed by Simon Ser
parent 1fc928d528
commit ec746d3e3e
2 changed files with 16 additions and 5 deletions

View file

@ -38,7 +38,18 @@ struct wlr_virtual_keyboard_v1 {
struct wlr_virtual_keyboard_manager_v1* wlr_virtual_keyboard_manager_v1_create(
struct wl_display *display);
/**
* Get the struct wlr_virtual_keyboard_v1 corresponding to a zwp_virtual_keyboard_v1 resource.
*
* Asserts that the resource is a valid zwp_virtual_keyboard_v1 resource created by wlroots.
*
* Returns NULL if the resource is inert.
*/
struct wlr_virtual_keyboard_v1 *wlr_virtual_keyboard_v1_from_resource(
struct wl_resource *resource);
struct wlr_virtual_keyboard_v1 *wlr_input_device_get_virtual_keyboard(
struct wlr_input_device *wlr_dev);
#endif