Ladybird+LibCore: Use QCoreApplication to drive the main Qt event loop

Using QEventLoop works for everything but it breaks *one* little feature
that we care about: automatically quitting the app when all windows have
been closed.

That only works if you drive the outermost main event loop with a
QCoreApplication instead of a QEventLoop. This is unfortunate, as it
complicates our API a little bit, but I'm sure we can think of a way to
make this nicer someday.

In order for QCoreApplication::exec() to process our own
ThreadEventQueue, we now have a zero-timer that we kick whenever new
events are posted to the thread queue.
This commit is contained in:
Andreas Kling 2023-04-25 16:53:07 +02:00
parent 0f22dfa634
commit c21eb30a2b
Notes: sideshowbarker 2024-07-17 01:51:00 +09:00
9 changed files with 79 additions and 25 deletions

View file

@ -522,4 +522,8 @@ void EventLoopImplementationUnix::unregister_notifier(Notifier& notifier)
ThreadData::the().notifiers.remove(&notifier);
}
void EventLoopImplementationUnix::did_post_event()
{
}
}