From 1f79f4ed1248cd32089709a7af8c5fc4ccd5c3fa Mon Sep 17 00:00:00 2001 From: Mathias Tillman Date: Wed, 9 Mar 2022 00:30:10 +0100 Subject: [PATCH] Fix rumble events causing hang because the received input events were not read properly. --- sunshine/platform/linux/input.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sunshine/platform/linux/input.cpp b/sunshine/platform/linux/input.cpp index fbdc8133..3c92ba81 100644 --- a/sunshine/platform/linux/input.cpp +++ b/sunshine/platform/linux/input.cpp @@ -716,6 +716,15 @@ inline void rumbleIterate(std::vector &effects, std::vector 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;