From 6131d879f7ee98dd24e643601c611d65ecd51afc Mon Sep 17 00:00:00 2001 From: Zaggy1024 Date: Tue, 11 Jul 2023 19:55:41 -0500 Subject: [PATCH] Ladybird: Process Qt event queue when polling the event loop The logic for `EventLoopImplementationQt::pump()` caused calls to `EventLoop::pump(PumpMode::DontWaitForEvents)` to not consume events posted to the Qt event queue. This caused the window to be unresponsive even when polling the event loop, if waiting was not desired. --- Ladybird/EventLoopImplementationQt.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Ladybird/EventLoopImplementationQt.cpp b/Ladybird/EventLoopImplementationQt.cpp index 933b4ef8fc..82e2adf32f 100644 --- a/Ladybird/EventLoopImplementationQt.cpp +++ b/Ladybird/EventLoopImplementationQt.cpp @@ -49,13 +49,11 @@ int EventLoopImplementationQt::exec() size_t EventLoopImplementationQt::pump(PumpMode mode) { auto result = Core::ThreadEventQueue::current().process(); - if (mode == PumpMode::WaitForEvents) { - if (is_main_loop()) - QCoreApplication::processEvents(QEventLoop::WaitForMoreEvents); - else - m_event_loop.processEvents(QEventLoop::WaitForMoreEvents); - } else { - } + auto qt_mode = mode == PumpMode::WaitForEvents ? QEventLoop::WaitForMoreEvents : QEventLoop::AllEvents; + if (is_main_loop()) + QCoreApplication::processEvents(qt_mode); + else + m_event_loop.processEvents(qt_mode); result += Core::ThreadEventQueue::current().process(); return result; }