Fix rumble events causing hang because the received input events were not read properly.

This commit is contained in:
Mathias Tillman 2022-03-09 00:30:10 +01:00
parent 4b658cd86b
commit 1f79f4ed12

View File

@ -716,6 +716,15 @@ inline void rumbleIterate(std::vector<effect_t> &effects, std::vector<pollfd_t>
return;
}
// Copy over the received events
for (auto x = 0; x < polls_tmp.size(); ++x) {
for (auto y = 0; y < polls.size(); ++y) {
if (polls_tmp[x].fd == polls[y].el.fd) {
polls[y].el.revents = polls_tmp[x].revents;
}
}
}
for(int x = 0; x < polls.size(); ++x) {
auto poll = std::begin(polls) + x;
auto effect_it = std::begin(effects) + x;