mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-15 08:56:26 -05:00
Reassign ownership of libinput handle
This commit is contained in:
parent
f479b7c8c7
commit
7a5f35b5bb
8 changed files with 64 additions and 23 deletions
|
|
@ -8,23 +8,10 @@
|
|||
#include "common/log.h"
|
||||
#include "types.h"
|
||||
|
||||
static void wlr_libinput_keyboard_destroy(struct wlr_keyboard_state *state) {
|
||||
libinput_device_unref(state->handle);
|
||||
free(state);
|
||||
}
|
||||
|
||||
static struct wlr_keyboard_impl keyboard_impl = {
|
||||
.destroy = wlr_libinput_keyboard_destroy
|
||||
};
|
||||
|
||||
struct wlr_keyboard *wlr_libinput_keyboard_create(
|
||||
struct libinput_device *device) {
|
||||
assert(device);
|
||||
struct wlr_keyboard_state *kbstate =
|
||||
calloc(1, sizeof(struct wlr_keyboard_state));
|
||||
kbstate->handle = device;
|
||||
libinput_device_ref(device);
|
||||
return wlr_keyboard_create(&keyboard_impl, kbstate);
|
||||
return wlr_keyboard_create(NULL, NULL);
|
||||
}
|
||||
|
||||
void handle_keyboard_key(struct libinput_event *event,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue