CMake: Add QPA Platform interface as optional component

This commit is contained in:
Jonas Kvinge
2025-01-25 11:18:39 +01:00
parent a683a279f5
commit 39f228f862
5 changed files with 22 additions and 22 deletions

View File

@@ -41,8 +41,8 @@
#cmakedefine INSTALL_TRANSLATIONS
#define TRANSLATIONS_DIR "${CMAKE_INSTALL_PREFIX}/share/strawberry/translations"
#cmakedefine HAVE_QPA_QPLATFORMNATIVEINTERFACE
#cmakedefine HAVE_QX11APPLICATION
#cmakedefine HAVE_QPA_QPLATFORMNATIVEINTERFACE_H
#cmakedefine ENABLE_WIN32_CONSOLE

View File

@@ -51,7 +51,7 @@
#include <QFlags>
#include <QtEvents>
#ifdef HAVE_QPA_QPLATFORMNATIVEINTERFACE_H
#ifdef HAVE_QPA_QPLATFORMNATIVEINTERFACE
# include <qpa/qplatformnativeinterface.h>
#endif
@@ -214,8 +214,8 @@ void OSDPretty::ScreenRemoved(QScreen *screen) {
bool OSDPretty::IsTransparencyAvailable() {
#ifdef HAVE_QPA_QPLATFORMNATIVEINTERFACE_H
if (qApp) {
#ifdef HAVE_QPA_QPLATFORMNATIVEINTERFACE
if (qApp && QGuiApplication::platformName() == "xcb"_L1) {
QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface();
QScreen *screen = popup_screen_ == nullptr ? QGuiApplication::primaryScreen() : popup_screen_;
if (native && screen) {