Przeglądaj źródła

Ladybird: Use plain QCoreApplication in WebContent process

Now that we no longer use QFont from LibWeb, we can also stop using
QGuiApplication in the WebContent process entirely.

This removes a whole bunch of unnecessary work from the event loop,
and also allows nice things like running headless-browser while
*actually* headless. :^)
Andreas Kling 1 rok temu
rodzic
commit
cc8c4266f5

+ 1 - 1
Ladybird/WebContent/CMakeLists.txt

@@ -27,7 +27,7 @@ qt_add_executable(WebContent ${WEBCONTENT_SOURCES})
 
 
 target_include_directories(WebContent PRIVATE ${SERENITY_SOURCE_DIR}/Userland/Services/)
 target_include_directories(WebContent PRIVATE ${SERENITY_SOURCE_DIR}/Userland/Services/)
 target_include_directories(WebContent PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/..)
 target_include_directories(WebContent PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/..)
-target_link_libraries(WebContent PRIVATE Qt::Core Qt::Gui Qt::Network Qt::Multimedia LibAudio LibCore LibFileSystem LibGfx LibIPC LibJS LibMain LibWeb LibWebSocket)
+target_link_libraries(WebContent PRIVATE Qt::Core Qt::Network Qt::Multimedia LibAudio LibCore LibFileSystem LibGfx LibIPC LibJS LibMain LibWeb LibWebSocket)
 if (ANDROID)
 if (ANDROID)
     link_android_libs(WebContent)
     link_android_libs(WebContent)
 endif()
 endif()

+ 2 - 2
Ladybird/WebContent/main.cpp

@@ -29,7 +29,7 @@
 #include <LibWeb/PermissionsPolicy/AutoplayAllowlist.h>
 #include <LibWeb/PermissionsPolicy/AutoplayAllowlist.h>
 #include <LibWeb/Platform/EventLoopPluginSerenity.h>
 #include <LibWeb/Platform/EventLoopPluginSerenity.h>
 #include <LibWeb/WebSockets/WebSocket.h>
 #include <LibWeb/WebSockets/WebSocket.h>
-#include <QGuiApplication>
+#include <QCoreApplication>
 #include <QTimer>
 #include <QTimer>
 #include <WebContent/ConnectionFromClient.h>
 #include <WebContent/ConnectionFromClient.h>
 #include <WebContent/PageHost.h>
 #include <WebContent/PageHost.h>
@@ -46,7 +46,7 @@ extern DeprecatedString s_serenity_resource_root;
 
 
 ErrorOr<int> serenity_main(Main::Arguments arguments)
 ErrorOr<int> serenity_main(Main::Arguments arguments)
 {
 {
-    QGuiApplication app(arguments.argc, arguments.argv);
+    QCoreApplication app(arguments.argc, arguments.argv);
 
 
 #if defined(AK_OS_MACOS)
 #if defined(AK_OS_MACOS)
     prohibit_interaction();
     prohibit_interaction();