Skip to content

Commit cb59a57

Browse files
authored
Merge pull request #132 from ardera/develop
Develop
2 parents 9f4deba + 4d3ddaa commit cb59a57

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

src/compositor.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1324,14 +1324,19 @@ static bool on_present_layers(
13241324
}
13251325

13261326
ok = drmdev_atomic_req_commit(req, req_flags, NULL);
1327-
if ((compositor->do_blocking_atomic_commits == false) && (ok < 0) && (errno == EBUSY)) {
1327+
if ((compositor->do_blocking_atomic_commits == false) && (ok == EBUSY)) {
13281328
printf("[compositor] Non-blocking drmModeAtomicCommit failed with EBUSY.\n"
13291329
" Future drmModeAtomicCommits will be executed blockingly.\n"
13301330
" This may have have an impact on performance.\n");
13311331

13321332
compositor->do_blocking_atomic_commits = true;
13331333
schedule_fake_page_flip_event = true;
13341334
goto do_commit;
1335+
} else if (ok != 0) {
1336+
fprintf(stderr, "[compositor] Could not present frame. drmModeAtomicCommit: %s\n", strerror(ok));
1337+
drmdev_destroy_atomic_req(req);
1338+
cpset_unlock(&compositor->cbs);
1339+
return false;
13351340
}
13361341

13371342
drmdev_destroy_atomic_req(req);

src/flutter-pi.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,8 +1959,19 @@ static int on_libinput_ready(sd_event_source *s, int fd, uint32_t revents, void
19591959
};
19601960
}
19611961
} else if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD)) {
1962-
data->keyboard_state = keyboard_state_new(flutterpi.input.keyboard_config, NULL, NULL);
1962+
if (flutterpi.input.disable_text_input == false) {
1963+
data->keyboard_state = keyboard_state_new(flutterpi.input.keyboard_config, NULL, NULL);
1964+
}
1965+
}
1966+
} else if (type == LIBINPUT_EVENT_DEVICE_REMOVED) {
1967+
device = libinput_event_get_device(event);
1968+
data = libinput_device_get_user_data(device);
1969+
1970+
if (data->keyboard_state) {
1971+
free(data->keyboard_state);
19631972
}
1973+
free(data);
1974+
libinput_device_set_user_data(device, NULL);
19641975
} else if (LIBINPUT_EVENT_IS_TOUCH(type)) {
19651976
touch_event = libinput_event_get_touch_event(event);
19661977
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
21502161
} else if (type == LIBINPUT_EVENT_POINTER_AXIS) {
21512162

21522163
}
2153-
} else if (LIBINPUT_EVENT_IS_KEYBOARD(type)) {
2164+
} else if (LIBINPUT_EVENT_IS_KEYBOARD(type) && !flutterpi.input.disable_text_input) {
21542165
struct keyboard_modifier_state mods;
21552166
enum libinput_key_state key_state;
21562167
xkb_keysym_t keysym;

0 commit comments

Comments
 (0)