diff --git a/src/compositor.c b/src/compositor.c index 9a22b585..3267d63b 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -1324,7 +1324,7 @@ static bool on_present_layers( } ok = drmdev_atomic_req_commit(req, req_flags, NULL); - if ((compositor->do_blocking_atomic_commits == false) && (ok < 0) && (errno == EBUSY)) { + if ((compositor->do_blocking_atomic_commits == false) && (ok == EBUSY)) { printf("[compositor] Non-blocking drmModeAtomicCommit failed with EBUSY.\n" " Future drmModeAtomicCommits will be executed blockingly.\n" " This may have have an impact on performance.\n"); @@ -1332,6 +1332,11 @@ static bool on_present_layers( compositor->do_blocking_atomic_commits = true; schedule_fake_page_flip_event = true; goto do_commit; + } else if (ok != 0) { + fprintf(stderr, "[compositor] Could not present frame. drmModeAtomicCommit: %s\n", strerror(ok)); + drmdev_destroy_atomic_req(req); + cpset_unlock(&compositor->cbs); + return false; } drmdev_destroy_atomic_req(req); diff --git a/src/flutter-pi.c b/src/flutter-pi.c index 18d6dfb8..8f7f58bf 100644 --- a/src/flutter-pi.c +++ b/src/flutter-pi.c @@ -1959,8 +1959,19 @@ static int on_libinput_ready(sd_event_source *s, int fd, uint32_t revents, void }; } } else if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD)) { - data->keyboard_state = keyboard_state_new(flutterpi.input.keyboard_config, NULL, NULL); + if (flutterpi.input.disable_text_input == false) { + data->keyboard_state = keyboard_state_new(flutterpi.input.keyboard_config, NULL, NULL); + } + } + } else if (type == LIBINPUT_EVENT_DEVICE_REMOVED) { + device = libinput_event_get_device(event); + data = libinput_device_get_user_data(device); + + if (data->keyboard_state) { + free(data->keyboard_state); } + free(data); + libinput_device_set_user_data(device, NULL); } else if (LIBINPUT_EVENT_IS_TOUCH(type)) { touch_event = libinput_event_get_touch_event(event); data = libinput_device_get_user_data(libinput_event_get_device(event)); @@ -2150,7 +2161,7 @@ static int on_libinput_ready(sd_event_source *s, int fd, uint32_t revents, void } else if (type == LIBINPUT_EVENT_POINTER_AXIS) { } - } else if (LIBINPUT_EVENT_IS_KEYBOARD(type)) { + } else if (LIBINPUT_EVENT_IS_KEYBOARD(type) && !flutterpi.input.disable_text_input) { struct keyboard_modifier_state mods; enum libinput_key_state key_state; xkb_keysym_t keysym;