Skip to content

fix libinput segfault #114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 31, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/flutter-pi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1889,6 +1889,11 @@ static void libinput_interface_on_close(int fd, void *userdata) {
close(fd);
}

const struct libinput_interface flutterpi_libinput_interface = {
.open_restricted = libinput_interface_on_open,
.close_restricted = libinput_interface_on_close
};

static int on_libinput_ready(sd_event_source *s, int fd, uint32_t revents, void *userdata) {
struct libinput_event_keyboard *keyboard_event;
struct libinput_event_pointer *pointer_event;
Expand Down Expand Up @@ -2360,10 +2365,7 @@ static struct libinput *try_create_udev_backed_libinput(void) {
}

libinput = libinput_udev_create_context(
&(const struct libinput_interface) {
.open_restricted = libinput_interface_on_open,
.close_restricted = libinput_interface_on_close
},
&flutterpi_libinput_interface,
udev,
udev
);
Expand Down Expand Up @@ -2391,10 +2393,7 @@ static struct libinput *try_create_path_backed_libinput(void) {
struct libinput *libinput;

libinput = libinput_path_create_context(
&(const struct libinput_interface) {
.open_restricted = libinput_interface_on_open,
.close_restricted = libinput_interface_on_close
},
&flutterpi_libinput_interface,
NULL
);
if (libinput == NULL) {
Expand Down