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,16 +222,16 @@ if(X11_FOUND)
else() else()
message(WARNING, "Missing X11/XF86keysym.h") message(WARNING, "Missing X11/XF86keysym.h")
endif() endif()
endif(X11_FOUND)
find_path(QPA_QPLATFORMNATIVEINTERFACE_H qpa/qplatformnativeinterface.h PATHS ${Qt${QT_MAJOR_VERSION}Gui_PRIVATE_INCLUDE_DIRS}) find_path(QPA_QPLATFORMNATIVEINTERFACE_H qpa/qplatformnativeinterface.h PATHS ${Qt${QT_MAJOR_VERSION}Gui_PRIVATE_INCLUDE_DIRS})
if(QPA_QPLATFORMNATIVEINTERFACE_H) if(QPA_QPLATFORMNATIVEINTERFACE_H)
set(HAVE_QPA_QPLATFORMNATIVEINTERFACE_H ON) set(HAVE_QPA_QPLATFORMNATIVEINTERFACE_H ON)
include_directories(${Qt${QT_MAJOR_VERSION}Gui_PRIVATE_INCLUDE_DIRS}) include_directories(${Qt${QT_MAJOR_VERSION}Gui_PRIVATE_INCLUDE_DIRS})
message(STATUS "Have qpa/qplatformnativeinterface.h header.") message(STATUS "Have qpa/qplatformnativeinterface.h header.")
else() else()
message(STATUS "Missing qpa/qplatformnativeinterface.h header.") message(STATUS "Missing qpa/qplatformnativeinterface.h header.")
endif() endif()
endif(X11_FOUND)
# TAGLIB # TAGLIB
pkg_check_modules(TAGLIB REQUIRED taglib>=1.11.1) pkg_check_modules(TAGLIB REQUIRED taglib>=1.11.1)

View File

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