1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +00:00

Ladybird: Run the Core::EventLoop with a Qt backend

This patch adds EventLoopImplementationQt which is a full replacement
for the Core::EventLoopImplementationUnix that uses Qt's event loop
as a backend instead.

This means that Core::Timer, Core::Notifier, and Core::Event delivery
are all driven by Qt primitives in the Ladybird UI and WC processes.
This commit is contained in:
Andreas Kling 2023-04-24 14:51:19 +02:00
parent 31289a8d57
commit 3494c2382d
6 changed files with 201 additions and 10 deletions

View file

@ -4,6 +4,8 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "../EventLoopImplementationQt.h"
#include "../EventLoopPluginQt.h"
#include "../FontPluginQt.h"
#include "../ImageCodecPluginLadybird.h"
@ -59,12 +61,11 @@ static void proxy_socket_through_notifier(ClientType& client, QSocketNotifier& n
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
// NOTE: This is only used for the Core::Socket inside the IPC connection.
// FIXME: Refactor things so we can get rid of this somehow.
Core::EventLoop event_loop;
QGuiApplication app(arguments.argc, arguments.argv);
Core::EventLoop::make_implementation = Ladybird::EventLoopImplementationQt::create;
Core::EventLoop event_loop;
platform_init();
Web::Platform::EventLoopPlugin::install(*new Ladybird::EventLoopPluginQt);
@ -109,7 +110,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
proxy_socket_through_notifier(webdriver, webdriver_notifier);
};
return app.exec();
return event_loop.exec();
}
static ErrorOr<void> load_content_filters()