LibCore: Add a hook for custom construction of EventLoopImplementation

This commit is contained in:
Andreas Kling 2023-04-24 14:47:52 +02:00
commit 31289a8d57
Notes: sideshowbarker 2024-07-17 21:16:31 +09:00
3 changed files with 7 additions and 1 deletions

View file

@ -30,8 +30,10 @@ bool has_event_loop()
}
}
Function<NonnullOwnPtr<EventLoopImplementation>()> EventLoop::make_implementation = EventLoopImplementationUnix::create;
EventLoop::EventLoop()
: m_impl(make<EventLoopImplementationUnix>())
: m_impl(make_implementation())
{
if (event_loop_stack().is_empty()) {
event_loop_stack().append(*this);