Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ boption(SERVICE_GREETD "Greetd" ON)
boption(SERVICE_UPOWER "UPower" ON)
boption(SERVICE_NOTIFICATIONS "Notifications" ON)
boption(BLUETOOTH "Bluetooth" ON)
boption(WEBVIEW "WebView" ON)

include(cmake/install-qml-module.cmake)
include(cmake/util.cmake)
Expand Down Expand Up @@ -128,6 +129,10 @@ if (DBUS)
list(APPEND QT_FPDEPS DBus)
endif()

if (WEBVIEW)
list(APPEND QT_FPDEPS WebView)
endif()

find_package(Qt6 REQUIRED COMPONENTS ${QT_FPDEPS})

# In Qt 6.10, private dependencies are required to be explicit,
Expand Down
5 changes: 5 additions & 0 deletions src/launch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ target_link_libraries(quickshell-launch PRIVATE
Qt::Quick Qt::Widgets CLI11::CLI11 quickshell-build
)

if(WEBVIEW)
add_compile_definitions(WEBVIEW_ENABLED)
target_link_libraries(quickshell-launch PRIVATE Qt::WebView)
endif()

qs_add_pchset(launch
DEPENDENCIES Qt::Core CLI11::CLI11
HEADERS
Expand Down
12 changes: 11 additions & 1 deletion src/launch/launch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
#include <qtextstream.h>
#include <unistd.h>

#ifdef WEBVIEW_ENABLED
#include <QtWebView>
#endif

#include "../core/common.hpp"
#include "../core/instanceinfo.hpp"
#include "../core/logging.hpp"
Expand Down Expand Up @@ -222,7 +226,13 @@ int launch(const LaunchArgs& args, char** argv, QCoreApplication* coreApplicatio
delete coreApplication;

QGuiApplication* app = nullptr;
auto qArgC = 0;
auto qArgC = 1;

#ifdef WEBVIEW_ENABLED
if (qEnvironmentVariable("QS_WEBVIEW", "0") == "1") {
QtWebView::initialize();
}
#endif

if (pragmas.useQApplication) {
app = new QApplication(qArgC, argv);
Expand Down
Loading