find_package(Qt6 REQUIRED COMPONENTS ${QT_COMPONENTS})
-set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication")
-add_subdirectory(third-party/singleapplication)
+if (NOT APPLE)
+ set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication")
+ add_subdirectory(third-party/singleapplication)
+endif()
if (CHECK_UPDATES)
add_subdirectory(openpgp)
Threads::Threads
${QRENCODE_LIBRARY}
${POLYSEED_LIBRARY}
- SingleApplication::SingleApplication
${ICU_LIBRARIES}
${LIBZIP_LIBRARIES}
${ZLIB_LIBRARIES}
${BCUR_LIBRARY}
)
+if(NOT APPLE)
+ target_link_libraries(feather PRIVATE SingleApplication::SingleApplication)
+endif()
+
if(CHECK_UPDATES)
target_link_libraries(feather PRIVATE openpgp)
endif()
#include <QApplication>
#include <QtCore>
#include <QtGui>
+#if !defined(Q_OS_MAC)
#include <singleapplication.h>
+#endif
#include "config-feather.h"
#include "constants.h"
int main(int argc, char *argv[])
{
+ qDebug() << "Reached main";
+
Q_INIT_RESOURCE(assets);
#if defined(Q_OS_LINUX) && defined(STACK_TRACE)
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Round);
#endif
+ qDebug() << "Setting up QApplication";
+
+#if defined(Q_OS_MAC)
+ // https://github.com/itay-grudev/SingleApplication/issues/136#issuecomment-1925441403
+ QApplication app(argc, argv);
+#else
SingleApplication app(argc, argv);
+#endif
QApplication::setQuitOnLastWindowClosed(false);
QApplication::setApplicationName("FeatherWallet");
-
// Setup config directories
QString configDir = Config::defaultConfigDir().path();
QString config_dir_tor = QString("%1/%2").arg(configDir, "tor");
auto wm = windowManager();
wm->setEventFilter(&filter);
+#if !defined(Q_OS_MAC)
QObject::connect(&app, &SingleApplication::instanceStarted, [&wm]() {
wm->raise();
});
+#endif
return QApplication::exec();
}