Fix QT_CONFIG check for wayland is only available since Qt6.7

This commit is contained in:
Nicolas Werner 2024-06-20 19:22:20 +02:00
parent 2142a8dd9c
commit 941f7f5ed5
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
2 changed files with 7 additions and 3 deletions

View file

@ -21,7 +21,7 @@
// in theory we can enable this everywhere, but the header is missing on some of our CI systems and // 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. // 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> #include <QtGui/qpa/qplatformwindow_p.h>
#endif #endif
@ -248,7 +248,9 @@ main(int argc, char *argv[])
if (!singleapp.isPrimaryInstance()) { if (!singleapp.isPrimaryInstance()) {
auto token = qgetenv("XDG_ACTIVATION_TOKEN"); 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 // 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... // when you have an actual window, that has the focus...
auto waylandApp = app.nativeInterface<QNativeInterface::QWaylandApplication>(); auto waylandApp = app.nativeInterface<QNativeInterface::QWaylandApplication>();

View file

@ -1044,7 +1044,9 @@ void
InputBar::toggleIgnore(const QString &user, const bool ignored) InputBar::toggleIgnore(const QString &user, const bool ignored)
{ {
if (!user.startsWith(u"@")) { 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; return;
} }