Only use QPlatformNativeInterface on X11

This commit is contained in:
Jonas Kvinge 2021-04-12 19:40:34 +02:00
parent 43876e967a
commit 531e97b499
2 changed files with 11 additions and 11 deletions

View File

@ -222,7 +222,6 @@ if(X11_FOUND)
else()
message(WARNING, "Missing X11/XF86keysym.h")
endif()
endif(X11_FOUND)
find_path(QPA_QPLATFORMNATIVEINTERFACE_H qpa/qplatformnativeinterface.h PATHS ${Qt${QT_MAJOR_VERSION}Gui_PRIVATE_INCLUDE_DIRS})
if(QPA_QPLATFORMNATIVEINTERFACE_H)
@ -232,6 +231,7 @@ if(QPA_QPLATFORMNATIVEINTERFACE_H)
else()
message(STATUS "Missing qpa/qplatformnativeinterface.h header.")
endif()
endif(X11_FOUND)
# TAGLIB
pkg_check_modules(TAGLIB REQUIRED taglib>=1.11.1)

View File

@ -55,7 +55,7 @@
#include <QtEvents>
#ifdef HAVE_X11EXTRAS
# include <QX11Info>
#elif defined(HAVE_QPA_QPLATFORMNATIVEINTERFACE_H)
#elif defined(Q_OS_UNIX) && defined(HAVE_QPA_QPLATFORMNATIVEINTERFACE_H)
# include <qpa/qplatformnativeinterface.h>
#endif
#ifdef HAVE_WINEXTRAS
@ -219,7 +219,7 @@ bool OSDPretty::IsTransparencyAvailable() {
#if defined(HAVE_X11EXTRAS)
return QX11Info::isCompositingManagerRunning();
#elif defined(HAVE_QPA_QPLATFORMNATIVEINTERFACE_H)
#elif defined(Q_OS_UNIX) && defined(HAVE_QPA_QPLATFORMNATIVEINTERFACE_H)
if (qApp) {
QPlatformNativeInterface *native = qApp->platformNativeInterface();
if (native) {