From 80b12d0a240eaaf2acf4367e148b4bfa8d7fb2a2 Mon Sep 17 00:00:00 2001 From: Hannes Winkler Date: Sat, 31 Oct 2020 17:09:27 +0100 Subject: [PATCH 1/3] don't handle keyboard events when disable text input is true make sure keyboard state is freed on keyboard unplug --- src/flutter-pi.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/flutter-pi.c b/src/flutter-pi.c index 4ac703c8..405f06d4 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 (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; From f14ed9520f4c1cd016fb712c4b14e92520c7aa0b Mon Sep 17 00:00:00 2001 From: Hannes Winkler Date: Fri, 4 Dec 2020 21:20:07 +0100 Subject: [PATCH 2/3] fix atomic commit return value handling in compositor --- src/compositor.c | 7 ++++++- src/flutter-pi.c | 2 +- third_party/aasdk | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) create mode 160000 third_party/aasdk 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 1ec81b2a..8f7f58bf 100644 --- a/src/flutter-pi.c +++ b/src/flutter-pi.c @@ -1963,7 +1963,7 @@ static int on_libinput_ready(sd_event_source *s, int fd, uint32_t revents, void data->keyboard_state = keyboard_state_new(flutterpi.input.keyboard_config, NULL, NULL); } } - } else if (LIBINPUT_EVENT_DEVICE_REMOVED) { + } else if (type == LIBINPUT_EVENT_DEVICE_REMOVED) { device = libinput_event_get_device(event); data = libinput_device_get_user_data(device); diff --git a/third_party/aasdk b/third_party/aasdk new file mode 160000 index 00000000..b4484b41 --- /dev/null +++ b/third_party/aasdk @@ -0,0 +1 @@ +Subproject commit b4484b4147f9e6e8a1e694a1b4f0cd237ee97a17 From 4d3ddaacac55912380d31e662082a0fc33f9d158 Mon Sep 17 00:00:00 2001 From: Hannes Winkler Date: Fri, 4 Dec 2020 21:56:56 +0100 Subject: [PATCH 3/3] remove aasdk submodule again --- third_party/aasdk | 1 - 1 file changed, 1 deletion(-) delete mode 160000 third_party/aasdk diff --git a/third_party/aasdk b/third_party/aasdk deleted file mode 160000 index b4484b41..00000000 --- a/third_party/aasdk +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b4484b4147f9e6e8a1e694a1b4f0cd237ee97a17