UI/AppKit: Fix wake() to use the correct run loop

wake() was using CFRunLoopGetCurrent() which returns the calling
thread's run loop. When called from an I/O thread to wake the main
thread's event loop, this would wake the wrong run loop.

Fixed by using the stored m_impl->run_loop which is captured at
construction time and refers to the event loop's owning thread.

(cherry-picked from commit da77c803c17015fa87254f85ae2da8a48b9ab071)
This commit is contained in:
Andreas Kling authored and Andrew Kaster committed 2026-06-29 10:07:38 -04:00
1 parent ec7fe009d1
commit b262ca13c9
2 files changed
+2 -2

No files matched your search

@@ -435,7 +435,7 @@ void CFEventLoopImplementation::quit(int exit_code)
void CFEventLoopImplementation::wake()
{
CFRunLoopWakeUp(CFRunLoopGetCurrent());
CFRunLoopWakeUp(m_impl->run_loop);
}
void CFEventLoopImplementation::post_event(Core::EventReceiver* receiver, NonnullOwnPtr<Core::Event>&& event)
@@ -436,7 +436,7 @@ void CFEventLoopImplementation::quit(int exit_code)
void CFEventLoopImplementation::wake()
{
CFRunLoopWakeUp(CFRunLoopGetCurrent());
CFRunLoopWakeUp(m_impl->run_loop);
}
void CFEventLoopImplementation::post_event(Core::EventReceiver* receiver, NonnullOwnPtr<Core::Event>&& event)