commit:     4f0947a3eaa3894cecc7148d81ed3ca0828cee59
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Apr  9 21:56:27 2023 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Apr  9 22:34:25 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4f0947a3

kde-plasma/xdg-desktop-portal-kde: Don't try to screencast nullptr

Upstream commit 58313fac8188163c9445bb9a212405412258ef5e

KDE-bug: https://bugs.kde.org/show_bug.cgi?id=467622

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 ...e-5.27.4.1-dont-try-to-screencast-nullptr.patch | 36 +++++++++++++
 .../xdg-desktop-portal-kde-5.27.4.1-r1.ebuild      | 61 ++++++++++++++++++++++
 2 files changed, 97 insertions(+)

diff --git 
a/kde-plasma/xdg-desktop-portal-kde/files/xdg-desktop-portal-kde-5.27.4.1-dont-try-to-screencast-nullptr.patch
 
b/kde-plasma/xdg-desktop-portal-kde/files/xdg-desktop-portal-kde-5.27.4.1-dont-try-to-screencast-nullptr.patch
new file mode 100644
index 000000000000..85d71e3951dc
--- /dev/null
+++ 
b/kde-plasma/xdg-desktop-portal-kde/files/xdg-desktop-portal-kde-5.27.4.1-dont-try-to-screencast-nullptr.patch
@@ -0,0 +1,36 @@
+From 58313fac8188163c9445bb9a212405412258ef5e Mon Sep 17 00:00:00 2001
+From: Aleix Pol Gonzalez <[email protected]>
+Date: Wed, 5 Apr 2023 16:36:48 +0000
+Subject: [PATCH] screencast: Don't try to screencast nullptr
+
+For some reason we were received an output that was null. Account for it
+by notifying and outputing some more information in hopes of fixing it
+soon.
+
+CCBUG: 467622
+---
+ src/waylandintegration.cpp | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/src/waylandintegration.cpp b/src/waylandintegration.cpp
+index c929b030..be6e19f7 100644
+--- a/src/waylandintegration.cpp
++++ b/src/waylandintegration.cpp
+@@ -282,6 +282,14 @@ WaylandIntegration::Stream 
WaylandIntegration::WaylandIntegrationPrivate::startS
+ WaylandIntegration::Stream 
WaylandIntegration::WaylandIntegrationPrivate::startStreamingOutput(quint32 
outputName, Screencasting::CursorMode mode)
+ {
+     auto output = m_outputMap.value(outputName).output();
++    if (!output) {
++        qCWarning(XdgDesktopPortalKdeWaylandIntegration) << "Cannot stream, 
output not found" << outputName << m_outputMap.keys();
++        auto notification = new 
KNotification(QStringLiteral("screencastfailure"), 
KNotification::CloseOnTimeout);
++        notification->setTitle(i18n("Failed to start screencasting"));
++        notification->setIconName(QStringLiteral("dialog-error"));
++        notification->sendEvent();
++        return {};
++    }
+     m_streamedScreenPosition = output->globalPosition();
+     return startStreaming(m_screencasting->createOutputStream(output.data(), 
mode),
+                           {
+-- 
+GitLab
+

diff --git 
a/kde-plasma/xdg-desktop-portal-kde/xdg-desktop-portal-kde-5.27.4.1-r1.ebuild 
b/kde-plasma/xdg-desktop-portal-kde/xdg-desktop-portal-kde-5.27.4.1-r1.ebuild
new file mode 100644
index 000000000000..425bf1a628cd
--- /dev/null
+++ 
b/kde-plasma/xdg-desktop-portal-kde/xdg-desktop-portal-kde-5.27.4.1-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+ECM_TEST="forceoptional"
+KFMIN=5.102.0
+PVCUT=$(ver_cut 1-3)
+QTMIN=5.15.7
+inherit ecm plasma.kde.org
+
+DESCRIPTION="Backend implementation for xdg-desktop-portal that is using 
Qt/KDE Frameworks"
+
+LICENSE="LGPL-2+"
+SLOT="5"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
+IUSE=""
+
+# dev-qt/qtgui: QtXkbCommonSupport is provided by either IUSE libinput or X
+COMMON_DEPEND="
+       >=dev-libs/wayland-1.15
+       >=dev-qt/qtdbus-${QTMIN}:5
+       >=dev-qt/qtdeclarative-${QTMIN}:5
+       || (
+               >=dev-qt/qtgui-${QTMIN}:5[libinput]
+               >=dev-qt/qtgui-${QTMIN}:5[X]
+       )
+       >=dev-qt/qtprintsupport-${QTMIN}:5[cups]
+       >=dev-qt/qtwayland-${QTMIN}:5
+       >=dev-qt/qtwidgets-${QTMIN}:5
+       >=kde-frameworks/kcoreaddons-${KFMIN}:5[dbus]
+       >=kde-frameworks/kconfig-${KFMIN}:5
+       >=kde-frameworks/kdeclarative-${KFMIN}:5
+       >=kde-frameworks/kglobalaccel-${KFMIN}:5
+       >=kde-frameworks/kguiaddons-${KFMIN}:5
+       >=kde-frameworks/ki18n-${KFMIN}:5
+       >=kde-frameworks/kiconthemes-${KFMIN}:5
+       >=kde-frameworks/kio-${KFMIN}:5
+       >=kde-frameworks/kirigami-${KFMIN}:5
+       >=kde-frameworks/knotifications-${KFMIN}:5
+       >=kde-frameworks/kwidgetsaddons-${KFMIN}:5
+       >=kde-frameworks/kwindowsystem-${KFMIN}:5
+       >=kde-frameworks/kwayland-${KFMIN}:5
+       >=kde-frameworks/plasma-${KFMIN}:5
+       x11-libs/libxkbcommon
+"
+DEPEND="${COMMON_DEPEND}
+       >=dev-libs/plasma-wayland-protocols-1.7.0
+       >=dev-libs/wayland-protocols-1.25
+       >=dev-qt/qtconcurrent-${QTMIN}:5
+"
+RDEPEND="${COMMON_DEPEND}
+       kde-misc/kio-fuse:5
+       sys-apps/xdg-desktop-portal
+"
+BDEPEND="
+       >=dev-qt/qtwaylandscanner-${QTMIN}:5
+       virtual/pkgconfig
+"
+
+PATCHES=( "${FILESDIR}/${P}-dont-try-to-screencast-nullptr.patch" ) # KDE-bug 
467622

Reply via email to