mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
types/wlr_keyboard: add base wlr_input_device
wlr_keyboard owns its base wlr_input_device. It will be initialized when the keyboard is initialized, and finished when the keyboard is destroyed.
This commit is contained in:
parent
130c3bcf63
commit
a1978b1299
12 changed files with 66 additions and 85 deletions
|
|
@ -785,14 +785,14 @@ void create_wl_keyboard(struct wlr_wl_seat *seat) {
|
|||
}
|
||||
|
||||
struct wlr_input_device *wlr_dev = &dev->wlr_input_device;
|
||||
|
||||
wlr_dev->keyboard = calloc(1, sizeof(*wlr_dev->keyboard));
|
||||
if (!wlr_dev->keyboard) {
|
||||
wlr_log_errno(WLR_ERROR, "Allocation failed");
|
||||
wlr_input_device_destroy(wlr_dev);
|
||||
return;
|
||||
}
|
||||
wlr_keyboard_init(wlr_dev->keyboard, NULL);
|
||||
|
||||
wlr_keyboard_init(wlr_dev->keyboard, NULL, wlr_dev->name);
|
||||
|
||||
wl_keyboard_add_listener(wl_keyboard, &keyboard_listener, wlr_dev);
|
||||
wlr_signal_emit_safe(&seat->backend->backend.events.new_input, wlr_dev);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue