From 1854e469f41112f8b8eb5bca665c3ba16427e273 Mon Sep 17 00:00:00 2001 From: Luiz Sardinha Date: Mon, 20 Apr 2026 20:39:08 +0200 Subject: [PATCH] refactor: making core a QApplication (so it runs cocoa loop on macOS) --- src/apps/deskflow-core/CMakeLists.txt | 1 + src/apps/deskflow-core/deskflow-core.cpp | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/apps/deskflow-core/CMakeLists.txt b/src/apps/deskflow-core/CMakeLists.txt index eac71bd08..2b4d990be 100644 --- a/src/apps/deskflow-core/CMakeLists.txt +++ b/src/apps/deskflow-core/CMakeLists.txt @@ -36,6 +36,7 @@ target_link_libraries( platform server app + Qt6::Widgets ${libs}) install( diff --git a/src/apps/deskflow-core/deskflow-core.cpp b/src/apps/deskflow-core/deskflow-core.cpp index 143b41ccb..993dd7eb7 100644 --- a/src/apps/deskflow-core/deskflow-core.cpp +++ b/src/apps/deskflow-core/deskflow-core.cpp @@ -19,10 +19,9 @@ #if defined(Q_OS_WIN) #include "arch/win32/ArchMiscWindows.h" -#include #endif -#include +#include #include #include #include @@ -102,17 +101,17 @@ int main(int argc, char **argv) App *coreApp = createApp(parser, events, processName); - QCoreApplication app(argc, argv); - QCoreApplication::setApplicationName(QStringLiteral("%1 Core").arg(kAppName)); + QApplication app(argc, argv); + QApplication::setApplicationName(QStringLiteral("%1 Core").arg(kAppName)); const auto ipcServer = new deskflow::core::ipc::CoreIpcServer(&app); // NOSONAR - Qt managed ipcServer->listen(); QThread coreThread; - QObject::connect(&coreThread, &QThread::finished, &app, &QCoreApplication::quit); + QObject::connect(&coreThread, &QThread::finished, &app, &QApplication::quit); coreApp->run(coreThread); - const auto exitCode = QCoreApplication::exec(); + const auto exitCode = QApplication::exec(); coreThread.wait(); LOG_DEBUG("core exited, code: %d", exitCode);