summaryrefslogtreecommitdiff
path: root/src/client_manager.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2018-01-21 12:00:40 +1100
committerMaxime Coste <mawww@kakoune.org>2018-01-21 12:00:40 +1100
commit299e22ca7c3a976c7f2edf99f4ff248f6e4c9f85 (patch)
tree9ab91ac81211ed0fe4a4203cf561411e3e834627 /src/client_manager.cc
parent43f50c0852a6f95abbcdf81f9d3bab9eeefbde0d (diff)
Do not block when waiting for next event if we have pending input
Handle next event should never block if we have already accumulated input that we want to process. As we can accumulate new input in lots of places (everytime we run a shell process for example, we might end up reading input keys. That can be triggered during the mode line generation which takes place during display of the window) Fixes #1804
Diffstat (limited to 'src/client_manager.cc')
-rw-r--r--src/client_manager.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/client_manager.cc b/src/client_manager.cc
index c721f1db..9cb5f8e5 100644
--- a/src/client_manager.cc
+++ b/src/client_manager.cc
@@ -90,6 +90,11 @@ void ClientManager::process_pending_inputs() const
}
}
+bool ClientManager::has_pending_inputs() const
+{
+ return contains_that(m_clients, [](auto&& c) { return c->has_pending_inputs(); });
+}
+
void ClientManager::remove_client(Client& client, bool graceful, int status)
{
auto it = find(m_clients, &client);