mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-25 02:38:59 +00:00
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.
This commit is contained in:
parent
a8f5cf9da7
commit
6131d879f7
Notes:
sideshowbarker
2024-07-17 08:36:27 +09:00
Author: https://github.com/Zaggy1024
Commit: 6131d879f7
Pull-request: https://github.com/SerenityOS/serenity/pull/19849
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/kleinesfilmroellchen
Reviewed-by: https://github.com/trflynn89
1 changed files with 5 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue