From 558833ca05ee40055ef3fe29b01a3cf01a6dd992 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Thu, 2 Oct 2025 08:28:12 -0400 Subject: [PATCH] fix: windows, unable to use settings until a QApp is made fixes: #9000 --- src/apps/deskflow-core/deskflow-core.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/apps/deskflow-core/deskflow-core.cpp b/src/apps/deskflow-core/deskflow-core.cpp index 5f78a4e05..5aa7c8179 100644 --- a/src/apps/deskflow-core/deskflow-core.cpp +++ b/src/apps/deskflow-core/deskflow-core.cpp @@ -31,6 +31,14 @@ void showHelp(const CoreArgParser &parser) int main(int argc, char **argv) { +#if SYSAPI_WIN32 + // HACK to make sure settings gets the correct qApp path + QCoreApplication m(argc, argv); + m.deleteLater(); + + ArchMiscWindows::setInstanceWin32(GetModuleHandle(nullptr)); +#endif + Arch arch; arch.init(); @@ -76,14 +84,6 @@ int main(int argc, char **argv) parser.parse(); -#if SYSAPI_WIN32 - // HACK to make sure settings gets the correct qApp path - QCoreApplication m(argc, argv); - m.deleteLater(); - - ArchMiscWindows::setInstanceWin32(GetModuleHandle(nullptr)); -#endif - EventQueue events; const auto processName = QFileInfo(argv[0]).fileName();