summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2024-06-20 19:22:20 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2024-06-20 20:16:33 +0200
commit941f7f5ed53be559d79633d8dd26e42e02389518 (patch)
tree68712b44f8e2ee1842769712b6545989dacc96bb /src
parentFix compilation on systems without specific platform interfaces (diff)
downloadnheko-941f7f5ed53be559d79633d8dd26e42e02389518.tar.xz
Fix QT_CONFIG check for wayland is only available since Qt6.7
Diffstat (limited to '')
-rw-r--r--src/main.cpp6
-rw-r--r--src/timeline/InputBar.cpp4
2 files changed, 7 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index cfee2180..392867bb 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -21,7 +21,7 @@
 
 // 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 QT_CONFIG(wayland)
+#if __has_include(<QtGui/qpa/qplatformwindow_p.h>)
 #include <QtGui/qpa/qplatformwindow_p.h>
 #endif
 
@@ -248,7 +248,9 @@ main(int argc, char *argv[])
     if (!singleapp.isPrimaryInstance()) {
         auto token = qgetenv("XDG_ACTIVATION_TOKEN");
 
-#if QT_CONFIG(wayland)
+#if __has_include(<QtGui/qpa/qplatformwindow_p.h>) && \
+        ((QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) &&  QT_CONFIG(wayland)) || \
+         (QT_VERSION < QT_VERSION_CHECK(6, 7, 0) && defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)))
         // 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>();
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp
index b8c7016d..c7687ab6 100644
--- a/src/timeline/InputBar.cpp
+++ b/src/timeline/InputBar.cpp
@@ -1044,7 +1044,9 @@ void
 InputBar::toggleIgnore(const QString &user, const bool ignored)
 {
     if (!user.startsWith(u"@")) {
-        MainWindow::instance()->showNotification(tr("You need to pass a valid mxid when ignoring a user. '%1' is not a valid userid.").arg(user));
+        MainWindow::instance()->showNotification(
+          tr("You need to pass a valid mxid when ignoring a user. '%1' is not a valid userid.")
+            .arg(user));
         return;
     }