Merge branch 'move_uinput' into 'master'
buffyboard: initialize uinput after libinput See merge request postmarketOS/buffybox!72
This commit is contained in:
commit
040c147ebc
1 changed files with 11 additions and 11 deletions
|
|
@ -198,11 +198,6 @@ int main(int argc, char *argv[]) {
|
|||
bb_config_parse_directory("/etc/buffyboard.conf.d", &conf_opts);
|
||||
bb_config_parse_files(cli_opts.config_files, cli_opts.num_config_files, &conf_opts);
|
||||
|
||||
/* Set up uinput device */
|
||||
if (!bb_uinput_device_init(sq2lv_unique_scancodes, sq2lv_num_unique_scancodes)) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
/* Initialise LVGL and set up logging callback */
|
||||
lv_init();
|
||||
lv_log_register_print_cb(bbx_log_print_cb);
|
||||
|
|
@ -275,6 +270,12 @@ int main(int argc, char *argv[]) {
|
|||
/* Apply default keyboard layout */
|
||||
sq2lv_switch_layout(keyboard, SQ2LV_LAYOUT_TERMINAL_US);
|
||||
|
||||
int fd_epoll = epoll_create1(EPOLL_CLOEXEC);
|
||||
if (fd_epoll == -1) {
|
||||
perror("epoll_create1() is failed");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
/* Open the file to track virtual terminals */
|
||||
fd_active = open("/sys/class/tty/tty0/active", O_RDONLY|O_NOCTTY|O_CLOEXEC);
|
||||
if (fd_active < 0) {
|
||||
|
|
@ -282,12 +283,6 @@ int main(int argc, char *argv[]) {
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
int fd_epoll = epoll_create1(EPOLL_CLOEXEC);
|
||||
if (fd_epoll == -1) {
|
||||
perror("epoll_create1() is failed");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
struct epoll_event event;
|
||||
event.events = EPOLLIN|EPOLLET;
|
||||
event.data.ptr = __extension__ (void*) on_new_terminal;
|
||||
|
|
@ -306,6 +301,11 @@ int main(int argc, char *argv[]) {
|
|||
if (bbx_indev_init(fd_epoll, &input_config) == 0)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
/* Set up uinput device */
|
||||
if (!bb_uinput_device_init(sq2lv_unique_scancodes, sq2lv_num_unique_scancodes)) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
/* Set signal handlers */
|
||||
struct sigaction action;
|
||||
action.sa_handler = signal_handler;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue