diff --git a/graphics/qt6-wayland/Makefile b/graphics/qt6-wayland/Makefile index 430aef820fe7..a63bdb800592 100644 --- a/graphics/qt6-wayland/Makefile +++ b/graphics/qt6-wayland/Makefile @@ -1,19 +1,20 @@ PORTNAME= wayland DISTVERSION= ${QT6_VERSION} +PORTREVISION= 1 CATEGORIES= graphics wayland PKGNAMEPREFIX= qt6- MAINTAINER= kde@FreeBSD.org COMMENT= Qt6 wrapper for Wayland BUILD_DEPENDS= ${LOCALBASE}/include/vulkan/vulkan.h:graphics/vulkan-headers LIB_DEPENDS= libwayland-client.so:graphics/wayland \ libxkbcommon.so:x11/libxkbcommon USES= cmake compiler:c++17-lang gl pkgconfig \ qt-dist:6 USE_GL= opengl egl USE_QT= base declarative svg USE_LDCONFIG= ${PREFIX}/${QT_LIBDIR_REL} .include diff --git a/graphics/qt6-wayland/files/patch-src_client_qwaylandshellsurface__p.h b/graphics/qt6-wayland/files/patch-src_client_qwaylandshellsurface__p.h new file mode 100644 index 000000000000..9380ad7616d6 --- /dev/null +++ b/graphics/qt6-wayland/files/patch-src_client_qwaylandshellsurface__p.h @@ -0,0 +1,23 @@ +Add QWaylandShellSurface::nativeResource() to allow using it instead of +surfaceRole(). The problem with latter is that it relies on RTTI, which is not +stable across shared modules loaded with RTLD_LOCAL. + +x11/plasma6-layer-shell-qt calls into this private API and crashes. Linux/GCC +users are not seeing this because libstdc++ use different algorithm for comparing +RTTI. Our libc++ can be switched to this algorithm too by building with +-DLIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION=2, but this is too drastic approach. + +Related URLs: +* https://bugs.kde.org/show_bug.cgi?id=479679 +* https://github.com/llvm/llvm-project/issues/36746 + +--- src/client/qwaylandshellsurface_p.h.orig 2025-05-29 00:19:49 UTC ++++ src/client/qwaylandshellsurface_p.h +@@ -85,6 +85,7 @@ class Q_WAYLANDCLIENT_EXPORT QWaylandShellSurface : pu + QPlatformWindow *platformWindow(); + struct wl_surface *wlSurface(); + ++ virtual void* nativeResource(const QByteArray&) { return nullptr; } + virtual std::any surfaceRole() const { return std::any(); }; + + virtual void attachPopup(QWaylandShellSurface *popup) { Q_UNUSED(popup); } diff --git a/graphics/qt6-wayland/files/patch-src_plugins_shellintegration_xdg-shell_qwaylandxdgshell__p.h b/graphics/qt6-wayland/files/patch-src_plugins_shellintegration_xdg-shell_qwaylandxdgshell__p.h new file mode 100644 index 000000000000..205ecb55e559 --- /dev/null +++ b/graphics/qt6-wayland/files/patch-src_plugins_shellintegration_xdg-shell_qwaylandxdgshell__p.h @@ -0,0 +1,13 @@ +Companion change to patch-src_plugins_shellintegration_xdg-shell_qwaylandxdgshell__p.h + +--- src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h.orig 2025-05-29 00:19:49 UTC ++++ src/plugins/shellintegration/xdg-shell/qwaylandxdgshell_p.h +@@ -75,7 +75,7 @@ class Q_WAYLANDCLIENT_EXPORT QWaylandXdgSurface : publ + + void setSizeHints(); + +- void *nativeResource(const QByteArray &resource); ++ void *nativeResource(const QByteArray &resource) override; + + std::any surfaceRole() const override; +