From 7b2d04cdd8a612eda4d5614346122ce0ceeca90c Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Tue, 9 Jan 2024 03:05:00 +0100 Subject: Fix macOS apple silicon build --- src/main.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index efe9333d..ab030ea4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,7 +19,9 @@ #include #include -#ifdef Q_OS_UNIX +// in theory we can enable this everywhere, but the header is missing on some of our CI systems and +// it is too much effort to install. +#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) #include #endif @@ -157,7 +159,6 @@ main(int argc, char *argv[]) QCoreApplication::setApplicationName(QStringLiteral("nheko")); QCoreApplication::setApplicationVersion(nheko::version); QCoreApplication::setOrganizationName(QStringLiteral("nheko")); - QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); // Disable the qml disk cache by default to prevent crashes on updates. See // https://github.com/Nheko-Reborn/nheko/issues/1383 @@ -167,7 +168,7 @@ main(int argc, char *argv[]) // this needs to be after setting the application name. Or how would we find our settings // file then? -#if !defined(Q_OS_MACOS) +#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) if (qgetenv("QT_SCALE_FACTOR").size() == 0) { float factor = utils::scaleFactor(); @@ -253,7 +254,7 @@ main(int argc, char *argv[]) if (!singleapp.isPrimaryInstance()) { auto token = qgetenv("XDG_ACTIVATION_TOKEN"); -#ifdef Q_OS_UNIX +#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) // getting a valid activation token on wayland is a bit of a pain, it works most reliably // when you have an actual window, that has the focus... auto waylandApp = app.nativeInterface(); -- cgit 1.4.1