From c3379e3734cf3557f2251985e06c5707bcec6ade Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 16 May 2020 22:02:53 +0200 Subject: [PATCH] LibCore: Always wait_for_events() when pumping the event loop This fixes an issue where continuously posting new events to the queue would keep the event loop saturated, causing it to ignore notifiers. Since notifiers are part of the big select(), we always have to call wait_for_events() even if there are pending events. We're already smart enough to select() without a timeout if we already have pending events. --- Libraries/LibCore/EventLoop.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Libraries/LibCore/EventLoop.cpp b/Libraries/LibCore/EventLoop.cpp index ca745468e0..0c1e48073e 100644 --- a/Libraries/LibCore/EventLoop.cpp +++ b/Libraries/LibCore/EventLoop.cpp @@ -320,8 +320,7 @@ int EventLoop::exec() void EventLoop::pump(WaitMode mode) { - if (m_queued_events.is_empty()) - wait_for_event(mode); + wait_for_event(mode); decltype(m_queued_events) events; {