mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibCore: Implement polling for events on Windows
This commit is contained in:
committed by
Gregory Bertilson
parent
2fd424ccb6
commit
e0a75d5084
Notes:
github-actions[bot]
2025-10-22 22:34:00 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/e0a75d50844 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6550
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user