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();