Fix macOS apple silicon build

This commit is contained in:
Nicolas Werner 2024-01-09 03:05:00 +01:00
parent 066c9f1593
commit 7b2d04cdd8
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -19,7 +19,9 @@
#include <QStandardPaths>
#include <QTranslator>
#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 <QtGui/qpa/qplatformwindow_p.h>
#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<QNativeInterface::QWaylandApplication>();