Fix compilation on systems without specific platform interfaces

fixes #1749
This commit is contained in:
Nicolas Werner 2024-06-20 17:07:30 +02:00
parent c7483aed98
commit 2142a8dd9c
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
2 changed files with 4 additions and 4 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 defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) #if QT_CONFIG(wayland)
#include <QtGui/qpa/qplatformwindow_p.h> #include <QtGui/qpa/qplatformwindow_p.h>
#endif #endif
@ -248,7 +248,7 @@ main(int argc, char *argv[])
if (!singleapp.isPrimaryInstance()) { if (!singleapp.isPrimaryInstance()) {
auto token = qgetenv("XDG_ACTIVATION_TOKEN"); 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 // 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

@ -19,7 +19,7 @@
#include "UserSettingsPage.h" #include "UserSettingsPage.h"
#include "Utils.h" #include "Utils.h"
#if XCB_AVAILABLE #if XCB_AVAILABLE && QT_CONFIG(xcb)
#include <xcb/xproto.h> #include <xcb/xproto.h>
#endif #endif
@ -186,7 +186,7 @@ Nheko::createRoom(bool space,
void void
Nheko::setWindowRole([[maybe_unused]] QWindow *win, [[maybe_unused]] QString newRole) const Nheko::setWindowRole([[maybe_unused]] QWindow *win, [[maybe_unused]] QString newRole) const
{ {
#if XCB_AVAILABLE #if XCB_AVAILABLE && QT_CONFIG(xcb)
const QNativeInterface::QX11Application *x11Interface = const QNativeInterface::QX11Application *x11Interface =
qGuiApp->nativeInterface<QNativeInterface::QX11Application>(); qGuiApp->nativeInterface<QNativeInterface::QX11Application>();