From 72bdf595cc1cf5b3abb068bfcc5a78ac57d52d9b Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 16 Dec 2019 17:44:26 +0100 Subject: [PATCH] LibIPC: Make sure we always process unhandled messages A client that only ever does synchronous IPC calls from its side would never actually process incoming asynchronous messages since they would arrive while waiting for a synchronous response and then end up sitting forever in the "unhandled messages" queue. We now always handle unhandled messages using a deferred invocation. This fixes the bug where Audio.MenuApplet didn't learn that the muted state changed in response to its own request to change it. :^) --- Libraries/LibIPC/IServerConnection.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Libraries/LibIPC/IServerConnection.h b/Libraries/LibIPC/IServerConnection.h index 60f6145914..03a3dcdae9 100644 --- a/Libraries/LibIPC/IServerConnection.h +++ b/Libraries/LibIPC/IServerConnection.h @@ -148,6 +148,12 @@ private: } ASSERT(decoded_bytes); } + + if (!m_unprocessed_messages.is_empty()) { + deferred_invoke([this](auto&) { + handle_messages(); + }); + } return true; }