commit:     a63274b03a791ec13fff137ba6f4b04391c56920
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Mar  8 10:28:55 2023 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Mar  8 11:06:55 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a63274b0

dev-qt/qtwayland: Do not cast placeholder screens to QWaylandScreen

KDE-bug: https://bugs.kde.org/show_bug.cgi?id=466674
See also: https://codereview.qt-project.org/c/qt/qtwayland/+/464669

Bug: https://bugs.gentoo.org/900358
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../files/qtwayland-5.15.8-KDEBUG-466674.patch     | 33 +++++++++++++++
 dev-qt/qtwayland/qtwayland-5.15.8-r2.ebuild        | 49 ++++++++++++++++++++++
 2 files changed, 82 insertions(+)

diff --git a/dev-qt/qtwayland/files/qtwayland-5.15.8-KDEBUG-466674.patch 
b/dev-qt/qtwayland/files/qtwayland-5.15.8-KDEBUG-466674.patch
new file mode 100644
index 000000000000..06ab3214f770
--- /dev/null
+++ b/dev-qt/qtwayland/files/qtwayland-5.15.8-KDEBUG-466674.patch
@@ -0,0 +1,33 @@
+From 5049ff99ea2687919a2246332511a2753c72d3cd Mon Sep 17 00:00:00 2001
+From: Aleix Pol <[email protected]>
+Date: Mon, 6 Mar 2023 01:11:45 +0100
+Subject: [PATCH] client: Do not cast placeholder screens to QWaylandScreen
+
+It's wrong to C-cast an object to a class that isn't theirs. Check if it
+is a placeholder first.
+
+Pick-to: 5.15 6.2 6.5
+Change-Id: I45d3c423422ae6638a033fb0f4cfefc7cd4460f0
+Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
+Reviewed-by: David Edmundson <[email protected]>
+(cherry picked from commit a53f022393a1276dbf8eccbae04cb0bd6cea0160)
+---
+ src/client/qwaylandnativeinterface.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/client/qwaylandnativeinterface.cpp 
b/src/client/qwaylandnativeinterface.cpp
+index bf54a1a00..9763c3123 100644
+--- a/src/client/qwaylandnativeinterface.cpp
++++ b/src/client/qwaylandnativeinterface.cpp
+@@ -139,7 +139,7 @@ void 
*QWaylandNativeInterface::nativeResourceForScreen(const QByteArray &resourc
+ {
+     QByteArray lowerCaseResource = resourceString.toLower();
+ 
+-    if (lowerCaseResource == "output")
++    if (lowerCaseResource == "output" && !screen->handle()->isPlaceholder())
+         return ((QWaylandScreen *) screen->handle())->output();
+ 
+     return nullptr;
+-- 
+GitLab
+

diff --git a/dev-qt/qtwayland/qtwayland-5.15.8-r2.ebuild 
b/dev-qt/qtwayland/qtwayland-5.15.8-r2.ebuild
new file mode 100644
index 000000000000..b80975a7165f
--- /dev/null
+++ b/dev-qt/qtwayland/qtwayland-5.15.8-r2.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+if [[ ${PV} != *9999* ]]; then
+       QT5_KDEPATCHSET_REV=2
+       KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~sparc 
~x86"
+fi
+
+inherit qt5-build
+
+DESCRIPTION="Wayland platform plugin for Qt"
+
+SLOT=5/${QT5_PV} # bug 815646
+IUSE="vulkan X"
+
+DEPEND="
+       dev-libs/wayland
+       =dev-qt/qtcore-${QT5_PV}*:5=
+       =dev-qt/qtdeclarative-${QT5_PV}*:5=
+       =dev-qt/qtgui-${QT5_PV}*:5=[egl,libinput,vulkan=,X?]
+       media-libs/libglvnd
+       vulkan? ( dev-util/vulkan-headers )
+       X? (
+               =dev-qt/qtgui-${QT5_PV}*[-gles2-only]
+               x11-libs/libX11
+               x11-libs/libXcomposite
+       )
+"
+RDEPEND="${DEPEND}"
+BDEPEND="dev-util/wayland-scanner"
+
+PATCHES=( "${FILESDIR}/${P}-KDEBUG-466674.patch" )
+
+src_configure() {
+       local myqmakeargs=(
+               --
+               $(qt_use vulkan feature-wayland-vulkan-server-buffer)
+               $(qt_use X feature-xcomposite-egl)
+               $(qt_use X feature-xcomposite-glx)
+       )
+       qt5-build_src_configure
+}
+
+src_install() {
+       qt5-build_src_install
+       rm "${D}${QT5_BINDIR}"/qtwaylandscanner || die
+}

Reply via email to