mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibCore: Implement polling for events on Windows
This commit is contained in:
parent
2fd424ccb6
commit
e0a75d5084
Notes:
github-actions[bot]
2025-10-22 22:34:00 +00:00
Author: https://github.com/Zaggy1024
Commit: e0a75d5084
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6550
1 changed files with 4 additions and 2 deletions
|
|
@ -93,7 +93,7 @@ int EventLoopImplementationWindows::exec()
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
size_t EventLoopImplementationWindows::pump(PumpMode)
|
||||
size_t EventLoopImplementationWindows::pump(PumpMode pump_mode)
|
||||
{
|
||||
auto& event_queue = ThreadEventQueue::current();
|
||||
auto* thread_data = ThreadData::the();
|
||||
|
|
@ -115,7 +115,9 @@ size_t EventLoopImplementationWindows::pump(PumpMode)
|
|||
event_handles.append(entry.key.handle);
|
||||
|
||||
bool has_pending_events = event_queue.has_pending_events();
|
||||
int timeout = has_pending_events ? 0 : INFINITE;
|
||||
DWORD timeout = 0;
|
||||
if (!has_pending_events && pump_mode == PumpMode::WaitForEvents)
|
||||
timeout = INFINITE;
|
||||
DWORD result = WaitForMultipleObjects(event_count, event_handles.data(), FALSE, timeout);
|
||||
if (result == WAIT_TIMEOUT) {
|
||||
// FIXME: This verification sometimes fails with ERROR_INVALID_HANDLE, but when I check
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue