diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2016-11-30 09:47:38 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2016-11-30 09:47:38 +0000 |
| commit | 540e504e68417d68cdd522c5d5924b61e612888f (patch) | |
| tree | b750563090bed24effc1a7af30a4cabea20c9176 /src/client_manager.cc | |
| parent | 3a81260917319e15b13e4f09dd9bc38f0b72b194 (diff) | |
Ensure all available input is handled before going back to main loop
We were not handling keys that could have been generated while handling
other keys (like during a shell evaluation).
Diffstat (limited to 'src/client_manager.cc')
| -rw-r--r-- | src/client_manager.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/client_manager.cc b/src/client_manager.cc index a77d7d13..8edaeb2f 100644 --- a/src/client_manager.cc +++ b/src/client_manager.cc @@ -63,8 +63,15 @@ Client* ClientManager::create_client(std::unique_ptr<UserInterface>&& ui, void ClientManager::process_pending_inputs() const { - for (auto& client : m_clients) - client->process_pending_inputs(); + while (true) + { + bool had_input = false; + for (auto& client : m_clients) + had_input = client->process_pending_inputs() or had_input; + + if (not had_input) + break; + } } void ClientManager::remove_client(Client& client, bool graceful) |
