summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.cc b/src/main.cc
index ec2b80bd..a7556905 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -908,14 +908,16 @@ int run_server(StringView session, StringView server_init,
// Loop so that eventual inputs happening during the processing are handled as
// well, avoiding unneeded redraws.
- bool allow_blocking = not client_manager.has_pending_inputs();
+ Optional<std::chrono::nanoseconds> timeout;
+ if (client_manager.has_pending_inputs())
+ timeout = std::chrono::nanoseconds{};
try
{
- while (event_manager.handle_next_events(EventMode::Normal, nullptr, allow_blocking))
+ while (event_manager.handle_next_events(EventMode::Normal, nullptr, timeout))
{
if (client_manager.process_pending_inputs())
break;
- allow_blocking = false;
+ timeout = std::chrono::nanoseconds{};
}
}
catch (const cancel&) {}