summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2024-06-20 17:07:30 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2024-06-20 17:07:30 +0200
commit2142a8dd9cb10334ac83404bba34f0024c388b76 (patch)
treeaae30cc6190507661eb7869a3efe382f7ae49e3e
parentFix crash on empty mxid in ignore commands (diff)
downloadnheko-2142a8dd9cb10334ac83404bba34f0024c388b76.tar.xz
Fix compilation on systems without specific platform interfaces
fixes #1749
-rw-r--r--src/main.cpp4
-rw-r--r--src/ui/NhekoGlobalObject.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 8ea15901..cfee2180 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 defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
+#if QT_CONFIG(wayland)
 #include <QtGui/qpa/qplatformwindow_p.h>
 #endif
 
@@ -248,7 +248,7 @@ main(int argc, char *argv[])
     if (!singleapp.isPrimaryInstance()) {
         auto token = qgetenv("XDG_ACTIVATION_TOKEN");
 
-#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
+#if QT_CONFIG(wayland)
         // 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/ui/NhekoGlobalObject.cpp b/src/ui/NhekoGlobalObject.cpp
index 138b4283..e28b1bc1 100644
--- a/src/ui/NhekoGlobalObject.cpp
+++ b/src/ui/NhekoGlobalObject.cpp
@@ -19,7 +19,7 @@
 #include "UserSettingsPage.h"
 #include "Utils.h"
 
-#if XCB_AVAILABLE
+#if XCB_AVAILABLE && QT_CONFIG(xcb)
 #include <xcb/xproto.h>
 #endif
 
@@ -186,7 +186,7 @@ Nheko::createRoom(bool space,
 void
 Nheko::setWindowRole([[maybe_unused]] QWindow *win, [[maybe_unused]] QString newRole) const
 {
-#if XCB_AVAILABLE
+#if XCB_AVAILABLE && QT_CONFIG(xcb)
     const QNativeInterface::QX11Application *x11Interface =
       qGuiApp->nativeInterface<QNativeInterface::QX11Application>();