From 0b2baea230a0f8e43b16bacea00a232ea3ed0f60 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sun, 7 Apr 2024 23:21:06 -0700 Subject: [PATCH] core: add IgnoreSystemSettings pragma --- src/core/main.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/main.cpp b/src/core/main.cpp index 8dd7ec76..36a8e6b6 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -27,6 +27,7 @@ int qs_main(int argc, char** argv) { auto useQApplication = false; auto nativeTextRendering = false; + auto desktopSettingsAware = true; QHash envOverrides; { @@ -271,6 +272,7 @@ int qs_main(int argc, char** argv) { if (pragma == "UseQApplication") useQApplication = true; else if (pragma == "NativeTextRendering") nativeTextRendering = true; + else if (pragma == "IgnoreSystemSettings") desktopSettingsAware = false; else if (pragma.startsWith("Env ")) { auto envPragma = pragma.sliced(4); auto splitIdx = envPragma.indexOf('='); @@ -297,7 +299,9 @@ int qs_main(int argc, char** argv) { qputenv(var.toUtf8(), val.toUtf8()); } - QCoreApplication* app = nullptr; + QGuiApplication::setDesktopSettingsAware(desktopSettingsAware); + + QGuiApplication* app = nullptr; if (useQApplication) { app = new QApplication(argc, argv); @@ -305,9 +309,6 @@ int qs_main(int argc, char** argv) { app = new QGuiApplication(argc, argv); } - QCoreApplication::setApplicationName("quickshell"); - QCoreApplication::setApplicationVersion("0.1.0 (" GIT_REVISION ")"); - if (!workingDirectory.isEmpty()) { QDir::setCurrent(workingDirectory); } @@ -325,7 +326,7 @@ int qs_main(int argc, char** argv) { auto root = RootWrapper(configFilePath); QGuiApplication::setQuitOnLastWindowClosed(false); - auto code = QCoreApplication::exec(); + auto code = QGuiApplication::exec(); delete app; return code; }