From 69c8497c982a6e82cd1c1762e27c3cdfe52436ed Mon Sep 17 00:00:00 2001 From: Ionen Wolkens Date: Thu, 17 Aug 2023 18:50:11 -0400 Subject: dev-qt/qtwayland: backport segfault fix with drag&drop Notably manifests itself with qutebrowser. Not very tested but is just a simple null check and so no worries. Signed-off-by: Ionen Wolkens --- .../files/qtwayland-6.5.2-drag-drop-segfault.patch | 38 ++++++++++++++++++++++ dev-qt/qtwayland/qtwayland-6.5.2-r1.ebuild | 24 ++++++++++++++ dev-qt/qtwayland/qtwayland-6.5.2.ebuild | 22 ------------- 3 files changed, 62 insertions(+), 22 deletions(-) create mode 100644 dev-qt/qtwayland/files/qtwayland-6.5.2-drag-drop-segfault.patch create mode 100644 dev-qt/qtwayland/qtwayland-6.5.2-r1.ebuild delete mode 100644 dev-qt/qtwayland/qtwayland-6.5.2.ebuild (limited to 'dev-qt') diff --git a/dev-qt/qtwayland/files/qtwayland-6.5.2-drag-drop-segfault.patch b/dev-qt/qtwayland/files/qtwayland-6.5.2-drag-drop-segfault.patch new file mode 100644 index 000000000000..d19522c4b8ef --- /dev/null +++ b/dev-qt/qtwayland/files/qtwayland-6.5.2-drag-drop-segfault.patch @@ -0,0 +1,38 @@ +Regression in 6.5.2 that is fixed >=6.5.3. +https://bugreports.qt.io/browse/QTBUG-115757 +https://github.com/qutebrowser/qutebrowser/issues/7827 + +https://github.com/qt/qtwayland/commit/02e9e0a2d4538eb2b3c26d3137228f8f501bcf7f +From: David Edmundson +Date: Wed, 7 Jun 2023 22:12:15 +0100 +Subject: [PATCH] client: Fix crash on dnd updates after client facing drag + ends + +A platform drag and a application-facing drag have two different +lifespans. + +The platform drag lasts until all mimedata is transferred and the client +receiving the drops marks it as finished. + +The application facing QDrag lasts until the client deletes it. We can +get a crash if we get updates during this time. + +The drop event is guarded, but not the action negotiation. + +Fixes: QTBUG-115757 +Change-Id: Ib9c047f04d65883105d4cd3f169637d0e038a63f +Reviewed-by: Eskil Abrahamsen Blomfeldt +(cherry picked from commit 22daca49b807fefba58113a06b86df4274e49f62) +Reviewed-by: David Edmundson +--- a/src/client/qwaylanddatadevice.cpp ++++ b/src/client/qwaylanddatadevice.cpp +@@ -97,6 +97,9 @@ bool QWaylandDataDevice::startDrag(QMimeData *mimeData, Qt::DropActions supporte + connect(m_dragSource.data(), &QWaylandDataSource::cancelled, this, &QWaylandDataDevice::dragSourceCancelled); + connect(m_dragSource.data(), &QWaylandDataSource::dndResponseUpdated, this, [this](bool accepted, Qt::DropAction action) { + auto drag = static_cast(QGuiApplicationPrivate::platformIntegration()->drag()); ++ if (!drag->currentDrag()) { ++ return; ++ } + // in old versions drop action is not set, so we guess + if (m_dragSource->version() < 3) { + drag->setResponse(accepted); diff --git a/dev-qt/qtwayland/qtwayland-6.5.2-r1.ebuild b/dev-qt/qtwayland/qtwayland-6.5.2-r1.ebuild new file mode 100644 index 000000000000..4fbc8c272b2c --- /dev/null +++ b/dev-qt/qtwayland/qtwayland-6.5.2-r1.ebuild @@ -0,0 +1,24 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit qt6-build + +DESCRIPTION="Wayland platform plugin for Qt" + +if [[ ${QT6_BUILD_TYPE} == release ]]; then + KEYWORDS="~amd64" +fi + +BDEPEND="dev-util/wayland-scanner" +DEPEND=" + dev-libs/wayland + =dev-qt/qtbase-${PV}*[egl,gui,opengl] + =dev-qt/qtdeclarative-${PV}* + media-libs/libglvnd + x11-libs/libxkbcommon +" +RDEPEND="${DEPEND}" + +PATCHES=( "${FILESDIR}/${P}-drag-drop-segfault.patch" ) diff --git a/dev-qt/qtwayland/qtwayland-6.5.2.ebuild b/dev-qt/qtwayland/qtwayland-6.5.2.ebuild deleted file mode 100644 index 14d6b705e8ef..000000000000 --- a/dev-qt/qtwayland/qtwayland-6.5.2.ebuild +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit qt6-build - -DESCRIPTION="Wayland platform plugin for Qt" - -if [[ ${QT6_BUILD_TYPE} == release ]]; then - KEYWORDS="~amd64" -fi - -BDEPEND="dev-util/wayland-scanner" -DEPEND=" - dev-libs/wayland - =dev-qt/qtbase-${PV}*[egl,gui,opengl] - =dev-qt/qtdeclarative-${PV}* - media-libs/libglvnd - x11-libs/libxkbcommon -" -RDEPEND="${DEPEND}" -- cgit v1.2.3-65-gdbad