mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-16 08:56:26 -05: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
|
|
@ -165,7 +165,7 @@ static bool backend_start(struct wlr_backend *backend) {
|
|||
|
||||
wlr_log(WLR_INFO, "Starting X11 backend");
|
||||
|
||||
wlr_signal_emit_safe(&x11->backend.events.new_input, &x11->keyboard_dev);
|
||||
wlr_signal_emit_safe(&x11->backend.events.new_input, &x11->keyboard.base);
|
||||
|
||||
for (size_t i = 0; i < x11->requested_outputs; ++i) {
|
||||
wlr_x11_output_create(&x11->backend);
|
||||
|
|
@ -186,7 +186,7 @@ static void backend_destroy(struct wlr_backend *backend) {
|
|||
wlr_output_destroy(&output->wlr_output);
|
||||
}
|
||||
|
||||
wlr_input_device_destroy(&x11->keyboard_dev);
|
||||
wlr_keyboard_destroy(&x11->keyboard);
|
||||
|
||||
wlr_backend_finish(backend);
|
||||
|
||||
|
|
@ -638,10 +638,7 @@ struct wlr_backend *wlr_x11_backend_create(struct wl_display *display,
|
|||
}
|
||||
#endif
|
||||
|
||||
wlr_input_device_init(&x11->keyboard_dev, WLR_INPUT_DEVICE_KEYBOARD,
|
||||
&input_device_impl, "X11 keyboard");
|
||||
wlr_keyboard_init(&x11->keyboard, &keyboard_impl);
|
||||
x11->keyboard_dev.keyboard = &x11->keyboard;
|
||||
wlr_keyboard_init(&x11->keyboard, &keyboard_impl, "x11-keyboard");
|
||||
|
||||
x11->display_destroy.notify = handle_display_destroy;
|
||||
wl_display_add_destroy_listener(display, &x11->display_destroy);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue