[vlc-commits] [Git][videolan/vlc][master] qt: csdmenu: check QT_CONFIG(wayland) before using QNativeInterface
Steve Lhomme (@robUx4)
gitlab at videolan.org
Mon Dec 16 11:45:40 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
86ecd6d0 by Alexandre Janniaux at 2024-12-16T11:28:51+00:00
qt: csdmenu: check QT_CONFIG(wayland) before using QNativeInterface
The Wayland parts are not available by default on the version compiled
by Homebrew, which makes the compilation break. On Qt version >= 6.7,
there is a QT_CONFIG(wayland)[^1] parameter which can be used to detect
whether the support is enabled or not.
Fatih found that before this version, Q_OS_UNIX was used in the code so
we can also detect that in the other cases.
[^1]: https://github.com/qt/qtbase/commit/a2ff329d2eb893ffae0d1cd18dd76bd494781295#diff-6ce1c6c83aa4b5db78a6748c8a9eec19620a10a2e2a495fd9053fdf391a9863aL4389
Co-authored-by: Fatih Uzunoglu <fuzun54 at outlook.com>
- - - - -
1 changed file:
- modules/gui/qt/util/csdmenu.cpp
Changes:
=====================================
modules/gui/qt/util/csdmenu.cpp
=====================================
@@ -34,6 +34,14 @@
#include <vlc_common.h>
#include <vlc_modules.h>
+#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0)
+#if defined(Q_OS_UNIX))
+#define QT_FEATURE_wayland 1
+#else
+#define QT_FEATURE_wayland -1
+#endif
+#endif
+
struct xdg_surface;
namespace {
@@ -155,7 +163,7 @@ public:
info.data.x11.connection = reinterpret_cast<struct xcb_connection_t*>(native->nativeResourceForIntegration(QByteArrayLiteral("connection")));
}
-#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
+#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) && QT_CONFIG(wayland)
if (m_plateform == QT_CSD_PLATFORM_WAYLAND)
{
info.platform = QT_CSD_PLATFORM_WAYLAND;
@@ -300,7 +308,7 @@ void CSDMenu::popup(const QPoint &pos)
event.data.x11.window = window->winId();
}
-#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
+#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) && QT_CONFIG(wayland)
if (d->m_plateform == QT_CSD_PLATFORM_WAYLAND)
{
event.platform = QT_CSD_PLATFORM_WAYLAND;
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/86ecd6d0a0aba18833f4b764651af4888576733f
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/86ecd6d0a0aba18833f4b764651af4888576733f
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list