1 |
commit: 7437df3200a260f6c048ca2455793e6cc0fbc461 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon May 30 15:45:53 2022 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 30 16:09:04 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7437df32 |
7 |
|
8 |
kde-plasma/xdg-desktop-portal-kde: Backport 5.24.6 screencast fixes |
9 |
|
10 |
See also: |
11 |
https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/102 |
12 |
https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/103 |
13 |
|
14 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
15 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
16 |
|
17 |
...ast-close-only-streams-of-closing-session.patch | 107 ++++++ |
18 |
...eencast-dont-provide-every-running-stream.patch | 358 +++++++++++++++++++++ |
19 |
...de-5.24.5-screencast-stop-stream-actively.patch | 28 ++ |
20 |
.../xdg-desktop-portal-kde-5.24.5-r2.ebuild | 51 +++ |
21 |
4 files changed, 544 insertions(+) |
22 |
|
23 |
diff --git a/kde-plasma/xdg-desktop-portal-kde/files/xdg-desktop-portal-kde-5.24.5-screencast-close-only-streams-of-closing-session.patch b/kde-plasma/xdg-desktop-portal-kde/files/xdg-desktop-portal-kde-5.24.5-screencast-close-only-streams-of-closing-session.patch |
24 |
new file mode 100644 |
25 |
index 000000000000..134f55c900b5 |
26 |
--- /dev/null |
27 |
+++ b/kde-plasma/xdg-desktop-portal-kde/files/xdg-desktop-portal-kde-5.24.5-screencast-close-only-streams-of-closing-session.patch |
28 |
@@ -0,0 +1,107 @@ |
29 |
+From cd8275c722aa25dd22353121131c914d3ab3b438 Mon Sep 17 00:00:00 2001 |
30 |
+From: Aleix Pol <aleixpol@×××.org> |
31 |
+Date: Sat, 28 May 2022 03:36:14 +0200 |
32 |
+Subject: [PATCH] screencast: When closing a session, only close the streams |
33 |
+ from that session |
34 |
+ |
35 |
+--- |
36 |
+ src/screencast.cpp | 11 ++++++++--- |
37 |
+ src/session.h | 12 ++++++++++++ |
38 |
+ src/waylandintegration.cpp | 5 +++++ |
39 |
+ src/waylandintegration.h | 1 + |
40 |
+ 4 files changed, 26 insertions(+), 3 deletions(-) |
41 |
+ |
42 |
+diff --git a/src/screencast.cpp b/src/screencast.cpp |
43 |
+index 5be6210..84cc4bd 100644 |
44 |
+--- a/src/screencast.cpp |
45 |
++++ b/src/screencast.cpp |
46 |
+@@ -68,8 +68,12 @@ uint ScreenCastPortal::CreateSession(const QDBusObjectPath &handle, |
47 |
+ return 2; |
48 |
+ } |
49 |
+ |
50 |
+- connect(session, &Session::closed, []() { |
51 |
+- WaylandIntegration::stopAllStreaming(); |
52 |
++ connect(session, &Session::closed, [session] { |
53 |
++ auto screencastSession = qobject_cast<ScreenCastSession *>(session); |
54 |
++ const auto streams = screencastSession->streams(); |
55 |
++ for (const WaylandIntegration::Stream &stream : streams) { |
56 |
++ WaylandIntegration::stopStreaming(stream.nodeId); |
57 |
++ } |
58 |
+ }); |
59 |
+ |
60 |
+ connect(WaylandIntegration::waylandIntegration(), &WaylandIntegration::WaylandIntegration::streamingStopped, session, &Session::close); |
61 |
+@@ -169,7 +173,8 @@ uint ScreenCastPortal::Start(const QDBusObjectPath &handle, |
62 |
+ return 2; |
63 |
+ } |
64 |
+ |
65 |
+- results.insert(QStringLiteral("streams"), QVariant::fromValue(streams)); |
66 |
++ session->setStreams(streams); |
67 |
++ results.insert(QStringLiteral("streams"), QVariant::fromValue<WaylandIntegration::Streams>(streams)); |
68 |
+ |
69 |
+ if (inhibitionsEnabled()) { |
70 |
+ new NotificationInhibition(app_id, i18nc("Do not disturb mode is enabled because...", "Screen sharing in progress"), session); |
71 |
+diff --git a/src/session.h b/src/session.h |
72 |
+index a42222e..dd05680 100644 |
73 |
+--- a/src/session.h |
74 |
++++ b/src/session.h |
75 |
+@@ -14,6 +14,7 @@ |
76 |
+ |
77 |
+ #include "remotedesktop.h" |
78 |
+ #include "screencast.h" |
79 |
++#include "waylandintegration.h" |
80 |
+ |
81 |
+ class Session : public QDBusVirtualObject |
82 |
+ { |
83 |
+@@ -62,10 +63,21 @@ public: |
84 |
+ return SessionType::ScreenCast; |
85 |
+ } |
86 |
+ |
87 |
++ WaylandIntegration::Streams streams() const |
88 |
++ { |
89 |
++ return m_streams; |
90 |
++ } |
91 |
++ void setStreams(const WaylandIntegration::Streams &streams) |
92 |
++ { |
93 |
++ m_streams = streams; |
94 |
++ } |
95 |
++ |
96 |
+ private: |
97 |
+ bool m_multipleSources; |
98 |
+ ScreenCastPortal::CursorModes m_cursorMode; |
99 |
+ ScreenCastPortal::SourceType m_types; |
100 |
++ |
101 |
++ WaylandIntegration::Streams m_streams; |
102 |
+ }; |
103 |
+ |
104 |
+ class RemoteDesktopSession : public ScreenCastSession |
105 |
+diff --git a/src/waylandintegration.cpp b/src/waylandintegration.cpp |
106 |
+index 9f5a177..e05f73a 100644 |
107 |
+--- a/src/waylandintegration.cpp |
108 |
++++ b/src/waylandintegration.cpp |
109 |
+@@ -89,6 +89,11 @@ void WaylandIntegration::stopAllStreaming() |
110 |
+ globalWaylandIntegration->stopAllStreaming(); |
111 |
+ } |
112 |
+ |
113 |
++void WaylandIntegration::stopStreaming(uint node) |
114 |
++{ |
115 |
++ globalWaylandIntegration->stopStreaming(node); |
116 |
++} |
117 |
++ |
118 |
+ void WaylandIntegration::requestPointerButtonPress(quint32 linuxButton) |
119 |
+ { |
120 |
+ globalWaylandIntegration->requestPointerButtonPress(linuxButton); |
121 |
+diff --git a/src/waylandintegration.h b/src/waylandintegration.h |
122 |
+index b8e6a00..784ee12 100644 |
123 |
+--- a/src/waylandintegration.h |
124 |
++++ b/src/waylandintegration.h |
125 |
+@@ -131,6 +131,7 @@ void startStreamingInput(); |
126 |
+ Stream startStreamingOutput(quint32 outputName, Screencasting::CursorMode mode); |
127 |
+ Stream startStreamingWindow(const QMap<int, QVariant> &win); |
128 |
+ void stopAllStreaming(); |
129 |
++void stopStreaming(uint node); |
130 |
+ |
131 |
+ void requestPointerButtonPress(quint32 linuxButton); |
132 |
+ void requestPointerButtonRelease(quint32 linuxButton); |
133 |
+-- |
134 |
+GitLab |
135 |
+ |
136 |
|
137 |
diff --git a/kde-plasma/xdg-desktop-portal-kde/files/xdg-desktop-portal-kde-5.24.5-screencast-dont-provide-every-running-stream.patch b/kde-plasma/xdg-desktop-portal-kde/files/xdg-desktop-portal-kde-5.24.5-screencast-dont-provide-every-running-stream.patch |
138 |
new file mode 100644 |
139 |
index 000000000000..6aa94ccb7f69 |
140 |
--- /dev/null |
141 |
+++ b/kde-plasma/xdg-desktop-portal-kde/files/xdg-desktop-portal-kde-5.24.5-screencast-dont-provide-every-running-stream.patch |
142 |
@@ -0,0 +1,358 @@ |
143 |
+From 3dbd366516c38d987025623feea18f79c15d72dd Mon Sep 17 00:00:00 2001 |
144 |
+From: Aleix Pol <aleixpol@×××.org> |
145 |
+Date: Mon, 30 May 2022 15:42:02 +0200 |
146 |
+Subject: [PATCH] Backport of 5f7fe7482ae3de6e5dabbd2712c283439b0eecac |
147 |
+ |
148 |
+Since the codebases had diverged over time, I've backported it by hand |
149 |
+using the same concepts as the forementioned fix, trying to minimise the |
150 |
+delta with the latest released Plasma 5.24. |
151 |
+--- |
152 |
+ src/remotedesktop.cpp | 12 ++------ |
153 |
+ src/screencast.cpp | 15 ++++++---- |
154 |
+ src/waylandintegration.cpp | 60 +++++++++++++++----------------------- |
155 |
+ src/waylandintegration.h | 26 +++++++++++++++-- |
156 |
+ src/waylandintegration_p.h | 15 ++-------- |
157 |
+ 5 files changed, 61 insertions(+), 67 deletions(-) |
158 |
+ |
159 |
+diff --git a/src/remotedesktop.cpp b/src/remotedesktop.cpp |
160 |
+index f36def4..9282ff0 100644 |
161 |
+--- a/src/remotedesktop.cpp |
162 |
++++ b/src/remotedesktop.cpp |
163 |
+@@ -122,20 +122,14 @@ uint RemoteDesktopPortal::Start(const QDBusObjectPath &handle, |
164 |
+ |
165 |
+ if (remoteDesktopDialog->exec()) { |
166 |
+ if (session->screenSharingEnabled()) { |
167 |
+- if (!WaylandIntegration::startStreamingOutput(remoteDesktopDialog->selectedScreens().first(), Screencasting::Hidden)) { |
168 |
++ auto stream = WaylandIntegration::startStreamingOutput(remoteDesktopDialog->selectedScreens().first(), Screencasting::Hidden); |
169 |
++ if (!stream.isValid()) { |
170 |
+ return 2; |
171 |
+ } |
172 |
+ |
173 |
+ WaylandIntegration::authenticate(); |
174 |
+ |
175 |
+- QVariant streams = WaylandIntegration::streams(); |
176 |
+- |
177 |
+- if (!streams.isValid()) { |
178 |
+- qCWarning(XdgDesktopPortalKdeRemoteDesktop()) << "Pipewire stream is not ready to be streamed"; |
179 |
+- return 2; |
180 |
+- } |
181 |
+- |
182 |
+- results.insert(QStringLiteral("streams"), streams); |
183 |
++ results.insert(QStringLiteral("streams"), QVariant::fromValue<WaylandIntegration::Streams>({stream})); |
184 |
+ } else { |
185 |
+ qCWarning(XdgDesktopPortalKdeRemoteDesktop()) << "Only stream input"; |
186 |
+ WaylandIntegration::startStreamingInput(); |
187 |
+diff --git a/src/screencast.cpp b/src/screencast.cpp |
188 |
+index 210bbbb..5be6210 100644 |
189 |
+--- a/src/screencast.cpp |
190 |
++++ b/src/screencast.cpp |
191 |
+@@ -147,26 +147,29 @@ uint ScreenCastPortal::Start(const QDBusObjectPath &handle, |
192 |
+ |
193 |
+ if (screenDialog->exec()) { |
194 |
+ const auto selectedScreens = screenDialog->selectedScreens(); |
195 |
++ WaylandIntegration::Streams streams; |
196 |
+ for (quint32 outputid : selectedScreens) { |
197 |
+- if (!WaylandIntegration::startStreamingOutput(outputid, Screencasting::CursorMode(session->cursorMode()))) { |
198 |
++ auto stream = WaylandIntegration::startStreamingOutput(outputid, Screencasting::CursorMode(session->cursorMode())); |
199 |
++ if (!stream.isValid()) { |
200 |
+ return 2; |
201 |
+ } |
202 |
++ streams << stream; |
203 |
+ } |
204 |
+ const auto selectedWindows = screenDialog->selectedWindows(); |
205 |
+ for (const auto &win : selectedWindows) { |
206 |
+- if (!WaylandIntegration::startStreamingWindow(win)) { |
207 |
++ auto stream = WaylandIntegration::startStreamingWindow(win); |
208 |
++ if (!stream.isValid()) { |
209 |
+ return 2; |
210 |
+ } |
211 |
++ streams << stream; |
212 |
+ } |
213 |
+ |
214 |
+- QVariant streams = WaylandIntegration::streams(); |
215 |
+- |
216 |
+- if (!streams.isValid()) { |
217 |
++ if (streams.isEmpty()) { |
218 |
+ qCWarning(XdgDesktopPortalKdeScreenCast) << "Pipewire stream is not ready to be streamed"; |
219 |
+ return 2; |
220 |
+ } |
221 |
+ |
222 |
+- results.insert(QStringLiteral("streams"), streams); |
223 |
++ results.insert(QStringLiteral("streams"), QVariant::fromValue(streams)); |
224 |
+ |
225 |
+ if (inhibitionsEnabled()) { |
226 |
+ new NotificationInhibition(app_id, i18nc("Do not disturb mode is enabled because...", "Screen sharing in progress"), session); |
227 |
+diff --git a/src/waylandintegration.cpp b/src/waylandintegration.cpp |
228 |
+index 44d862a..9f5a177 100644 |
229 |
+--- a/src/waylandintegration.cpp |
230 |
++++ b/src/waylandintegration.cpp |
231 |
+@@ -43,7 +43,7 @@ Q_LOGGING_CATEGORY(XdgDesktopPortalKdeWaylandIntegration, "xdp-kde-wayland-integ |
232 |
+ |
233 |
+ Q_GLOBAL_STATIC(WaylandIntegration::WaylandIntegrationPrivate, globalWaylandIntegration) |
234 |
+ |
235 |
+-static QDebug operator<<(QDebug dbg, const WaylandIntegration::WaylandIntegrationPrivate::Stream &c) |
236 |
++static QDebug operator<<(QDebug dbg, const WaylandIntegration::Stream &c) |
237 |
+ { |
238 |
+ dbg.nospace() << "Stream(" << c.map << ", " << c.nodeId << ")"; |
239 |
+ return dbg.space(); |
240 |
+@@ -74,12 +74,12 @@ void WaylandIntegration::startStreamingInput() |
241 |
+ globalWaylandIntegration->startStreamingInput(); |
242 |
+ } |
243 |
+ |
244 |
+-bool WaylandIntegration::startStreamingOutput(quint32 outputName, Screencasting::CursorMode mode) |
245 |
++WaylandIntegration::Stream WaylandIntegration::startStreamingOutput(quint32 outputName, Screencasting::CursorMode mode) |
246 |
+ { |
247 |
+ return globalWaylandIntegration->startStreamingOutput(outputName, mode); |
248 |
+ } |
249 |
+ |
250 |
+-bool WaylandIntegration::startStreamingWindow(const QMap<int, QVariant> &win) |
251 |
++WaylandIntegration::Stream WaylandIntegration::startStreamingWindow(const QMap<int, QVariant> &win) |
252 |
+ { |
253 |
+ return globalWaylandIntegration->startStreamingWindow(win); |
254 |
+ } |
255 |
+@@ -124,11 +124,6 @@ QMap<quint32, WaylandIntegration::WaylandOutput> WaylandIntegration::screens() |
256 |
+ return globalWaylandIntegration->screens(); |
257 |
+ } |
258 |
+ |
259 |
+-QVariant WaylandIntegration::streams() |
260 |
+-{ |
261 |
+- return globalWaylandIntegration->streams(); |
262 |
+-} |
263 |
+- |
264 |
+ // Thank you kscreen |
265 |
+ void WaylandIntegration::WaylandOutput::setOutputType(const QString &type) |
266 |
+ { |
267 |
+@@ -157,7 +152,9 @@ void WaylandIntegration::WaylandOutput::setOutputType(const QString &type) |
268 |
+ } |
269 |
+ } |
270 |
+ |
271 |
+-const QDBusArgument &operator>>(const QDBusArgument &arg, WaylandIntegration::WaylandIntegrationPrivate::Stream &stream) |
272 |
++namespace WaylandIntegration |
273 |
++{ |
274 |
++const QDBusArgument &operator>>(const QDBusArgument &arg, Stream &stream) |
275 |
+ { |
276 |
+ arg.beginStructure(); |
277 |
+ arg >> stream.nodeId; |
278 |
+@@ -177,7 +174,7 @@ const QDBusArgument &operator>>(const QDBusArgument &arg, WaylandIntegration::Wa |
279 |
+ return arg; |
280 |
+ } |
281 |
+ |
282 |
+-const QDBusArgument &operator<<(QDBusArgument &arg, const WaylandIntegration::WaylandIntegrationPrivate::Stream &stream) |
283 |
++const QDBusArgument &operator<<(QDBusArgument &arg, const Stream &stream) |
284 |
+ { |
285 |
+ arg.beginStructure(); |
286 |
+ arg << stream.nodeId; |
287 |
+@@ -186,9 +183,7 @@ const QDBusArgument &operator<<(QDBusArgument &arg, const WaylandIntegration::Wa |
288 |
+ |
289 |
+ return arg; |
290 |
+ } |
291 |
+- |
292 |
+-Q_DECLARE_METATYPE(WaylandIntegration::WaylandIntegrationPrivate::Stream) |
293 |
+-Q_DECLARE_METATYPE(WaylandIntegration::WaylandIntegrationPrivate::Streams) |
294 |
++} |
295 |
+ |
296 |
+ KWayland::Client::PlasmaWindowManagement *WaylandIntegration::plasmaWindowManagement() |
297 |
+ { |
298 |
+@@ -207,8 +202,8 @@ WaylandIntegration::WaylandIntegrationPrivate::WaylandIntegrationPrivate() |
299 |
+ , m_fakeInput(nullptr) |
300 |
+ , m_screencasting(nullptr) |
301 |
+ { |
302 |
+- qDBusRegisterMetaType<WaylandIntegrationPrivate::Stream>(); |
303 |
+- qDBusRegisterMetaType<WaylandIntegrationPrivate::Streams>(); |
304 |
++ qDBusRegisterMetaType<Stream>(); |
305 |
++ qDBusRegisterMetaType<Streams>(); |
306 |
+ } |
307 |
+ |
308 |
+ WaylandIntegration::WaylandIntegrationPrivate::~WaylandIntegrationPrivate() = default; |
309 |
+@@ -228,25 +223,25 @@ void WaylandIntegration::WaylandIntegrationPrivate::startStreamingInput() |
310 |
+ m_streamInput = true; |
311 |
+ } |
312 |
+ |
313 |
+-bool WaylandIntegration::WaylandIntegrationPrivate::startStreamingWindow(const QMap<int, QVariant> &win) |
314 |
++WaylandIntegration::Stream WaylandIntegration::WaylandIntegrationPrivate::startStreamingWindow(const QMap<int, QVariant> &win) |
315 |
+ { |
316 |
+ auto uuid = win[KWayland::Client::PlasmaWindowModel::Uuid].toString(); |
317 |
+ return startStreaming(m_screencasting->createWindowStream(uuid, Screencasting::Hidden), {}, win); |
318 |
+ } |
319 |
+ |
320 |
+-bool WaylandIntegration::WaylandIntegrationPrivate::startStreamingOutput(quint32 outputName, Screencasting::CursorMode mode) |
321 |
++WaylandIntegration::Stream WaylandIntegration::WaylandIntegrationPrivate::startStreamingOutput(quint32 outputName, Screencasting::CursorMode mode) |
322 |
+ { |
323 |
+ auto output = m_outputMap.value(outputName).output(); |
324 |
+ |
325 |
+ return startStreaming(m_screencasting->createOutputStream(output.data(), mode), output, {}); |
326 |
+ } |
327 |
+ |
328 |
+-bool WaylandIntegration::WaylandIntegrationPrivate::startStreaming(ScreencastingStream *stream, |
329 |
+- QSharedPointer<KWayland::Client::Output> output, |
330 |
+- const QMap<int, QVariant> &win) |
331 |
++WaylandIntegration::Stream WaylandIntegration::WaylandIntegrationPrivate::startStreaming(ScreencastingStream *stream, |
332 |
++ QSharedPointer<KWayland::Client::Output> output, |
333 |
++ const QMap<int, QVariant> &win) |
334 |
+ { |
335 |
+ QEventLoop loop; |
336 |
+- bool streamReady = false; |
337 |
++ Stream ret; |
338 |
+ connect(stream, &ScreencastingStream::failed, this, [&](const QString &error) { |
339 |
+ qCWarning(XdgDesktopPortalKdeWaylandIntegration) << "failed to start streaming" << stream << error; |
340 |
+ |
341 |
+@@ -255,30 +250,26 @@ bool WaylandIntegration::WaylandIntegrationPrivate::startStreaming(Screencasting |
342 |
+ notification->setText(error); |
343 |
+ notification->setIconName(QStringLiteral("dialog-error")); |
344 |
+ notification->sendEvent(); |
345 |
+- |
346 |
+- streamReady = false; |
347 |
+ loop.quit(); |
348 |
+ }); |
349 |
+ connect(stream, &ScreencastingStream::created, this, [&](uint32_t nodeid) { |
350 |
+- Stream s; |
351 |
+- s.stream = stream; |
352 |
+- s.nodeId = nodeid; |
353 |
++ ret.stream = stream; |
354 |
++ ret.nodeId = nodeid; |
355 |
+ if (output) { |
356 |
+ m_streamedScreenPosition = output->globalPosition(); |
357 |
+- s.map = { |
358 |
++ ret.map = { |
359 |
+ {QLatin1String("size"), output->pixelSize()}, |
360 |
+ {QLatin1String("source_type"), static_cast<uint>(ScreenCastPortal::Monitor)}, |
361 |
+ }; |
362 |
+ } else { |
363 |
+- s.map = {{QLatin1String("source_type"), static_cast<uint>(ScreenCastPortal::Window)}}; |
364 |
++ ret.map = {{QLatin1String("source_type"), static_cast<uint>(ScreenCastPortal::Window)}}; |
365 |
+ } |
366 |
+- m_streams.append(s); |
367 |
++ m_streams.append(ret); |
368 |
+ startStreamingInput(); |
369 |
+ |
370 |
+ connect(stream, &ScreencastingStream::closed, this, [this, nodeid] { |
371 |
+ stopStreaming(nodeid); |
372 |
+ }); |
373 |
+- streamReady = true; |
374 |
+ |
375 |
+ auto item = new KStatusNotifierItem(stream); |
376 |
+ item->setStandardActionsEnabled(false); |
377 |
+@@ -303,10 +294,10 @@ bool WaylandIntegration::WaylandIntegrationPrivate::startStreaming(Screencasting |
378 |
+ QTimer::singleShot(3000, &loop, &QEventLoop::quit); |
379 |
+ loop.exec(); |
380 |
+ |
381 |
+- return streamReady; |
382 |
++ return ret; |
383 |
+ } |
384 |
+ |
385 |
+-void WaylandIntegration::WaylandIntegrationPrivate::Stream::close() |
386 |
++void WaylandIntegration::Stream::close() |
387 |
+ { |
388 |
+ stream->deleteLater(); |
389 |
+ } |
390 |
+@@ -390,11 +381,6 @@ QMap<quint32, WaylandIntegration::WaylandOutput> WaylandIntegration::WaylandInte |
391 |
+ return m_outputMap; |
392 |
+ } |
393 |
+ |
394 |
+-QVariant WaylandIntegration::WaylandIntegrationPrivate::streams() |
395 |
+-{ |
396 |
+- return QVariant::fromValue<WaylandIntegrationPrivate::Streams>(m_streams); |
397 |
+-} |
398 |
+- |
399 |
+ void WaylandIntegration::WaylandIntegrationPrivate::authenticate() |
400 |
+ { |
401 |
+ if (!m_waylandAuthenticationRequested) { |
402 |
+diff --git a/src/waylandintegration.h b/src/waylandintegration.h |
403 |
+index 04319c9..b8e6a00 100644 |
404 |
+--- a/src/waylandintegration.h |
405 |
++++ b/src/waylandintegration.h |
406 |
+@@ -9,6 +9,7 @@ |
407 |
+ #ifndef XDG_DESKTOP_PORTAL_KDE_WAYLAND_INTEGRATION_H |
408 |
+ #define XDG_DESKTOP_PORTAL_KDE_WAYLAND_INTEGRATION_H |
409 |
+ |
410 |
++#include <QDBusArgument> |
411 |
+ #include <QObject> |
412 |
+ #include <QPoint> |
413 |
+ #include <QSize> |
414 |
+@@ -28,6 +29,23 @@ class ScreencastingSource; |
415 |
+ |
416 |
+ namespace WaylandIntegration |
417 |
+ { |
418 |
++ |
419 |
++struct Stream { |
420 |
++ ScreencastingStream *stream = nullptr; |
421 |
++ uint nodeId; |
422 |
++ QVariantMap map; |
423 |
++ |
424 |
++ bool isValid() const |
425 |
++ { |
426 |
++ return stream != nullptr; |
427 |
++ } |
428 |
++ |
429 |
++ void close(); |
430 |
++}; |
431 |
++typedef QVector<Stream> Streams; |
432 |
++const QDBusArgument &operator<<(QDBusArgument &arg, const Stream &stream); |
433 |
++const QDBusArgument &operator>>(const QDBusArgument &arg, Stream &stream); |
434 |
++ |
435 |
+ class WaylandOutput |
436 |
+ { |
437 |
+ public: |
438 |
+@@ -110,8 +128,8 @@ bool isStreamingEnabled(); |
439 |
+ bool isStreamingAvailable(); |
440 |
+ |
441 |
+ void startStreamingInput(); |
442 |
+-bool startStreamingOutput(quint32 outputName, Screencasting::CursorMode mode); |
443 |
+-bool startStreamingWindow(const QMap<int, QVariant> &win); |
444 |
++Stream startStreamingOutput(quint32 outputName, Screencasting::CursorMode mode); |
445 |
++Stream startStreamingWindow(const QMap<int, QVariant> &win); |
446 |
+ void stopAllStreaming(); |
447 |
+ |
448 |
+ void requestPointerButtonPress(quint32 linuxButton); |
449 |
+@@ -123,7 +141,6 @@ void requestPointerAxisDiscrete(Qt::Orientation axis, qreal delta); |
450 |
+ void requestKeyboardKeycode(int keycode, bool state); |
451 |
+ |
452 |
+ QMap<quint32, WaylandOutput> screens(); |
453 |
+-QVariant streams(); |
454 |
+ |
455 |
+ void init(); |
456 |
+ |
457 |
+@@ -132,4 +149,7 @@ KWayland::Client::PlasmaWindowManagement *plasmaWindowManagement(); |
458 |
+ WaylandIntegration *waylandIntegration(); |
459 |
+ } |
460 |
+ |
461 |
++Q_DECLARE_METATYPE(WaylandIntegration::Stream) |
462 |
++Q_DECLARE_METATYPE(WaylandIntegration::Streams) |
463 |
++ |
464 |
+ #endif // XDG_DESKTOP_PORTAL_KDE_WAYLAND_INTEGRATION_H |
465 |
+diff --git a/src/waylandintegration_p.h b/src/waylandintegration_p.h |
466 |
+index 220ad3d..e95f6a0 100644 |
467 |
+--- a/src/waylandintegration_p.h |
468 |
++++ b/src/waylandintegration_p.h |
469 |
+@@ -53,15 +53,6 @@ private: |
470 |
+ KWayland::Client::PlasmaWindowManagement *m_windowManagement = nullptr; |
471 |
+ |
472 |
+ public: |
473 |
+- struct Stream { |
474 |
+- ScreencastingStream *stream = nullptr; |
475 |
+- uint nodeId; |
476 |
+- QVariantMap map; |
477 |
+- |
478 |
+- void close(); |
479 |
+- }; |
480 |
+- typedef QVector<Stream> Streams; |
481 |
+- |
482 |
+ void authenticate(); |
483 |
+ |
484 |
+ bool isStreamingEnabled() const; |
485 |
+@@ -69,9 +60,9 @@ public: |
486 |
+ |
487 |
+ void startStreamingInput(); |
488 |
+ |
489 |
+- bool startStreaming(ScreencastingStream *stream, QSharedPointer<KWayland::Client::Output> output, const QMap<int, QVariant> &win); |
490 |
+- bool startStreamingOutput(quint32 outputName, Screencasting::CursorMode mode); |
491 |
+- bool startStreamingWindow(const QMap<int, QVariant> &win); |
492 |
++ Stream startStreaming(ScreencastingStream *stream, QSharedPointer<KWayland::Client::Output> output, const QMap<int, QVariant> &win); |
493 |
++ Stream startStreamingOutput(quint32 outputName, Screencasting::CursorMode mode); |
494 |
++ Stream startStreamingWindow(const QMap<int, QVariant> &win); |
495 |
+ void stopStreaming(uint32_t nodeid); |
496 |
+ void stopAllStreaming(); |
497 |
+ |
498 |
+-- |
499 |
+GitLab |
500 |
+ |
501 |
|
502 |
diff --git a/kde-plasma/xdg-desktop-portal-kde/files/xdg-desktop-portal-kde-5.24.5-screencast-stop-stream-actively.patch b/kde-plasma/xdg-desktop-portal-kde/files/xdg-desktop-portal-kde-5.24.5-screencast-stop-stream-actively.patch |
503 |
new file mode 100644 |
504 |
index 000000000000..3c1284108b20 |
505 |
--- /dev/null |
506 |
+++ b/kde-plasma/xdg-desktop-portal-kde/files/xdg-desktop-portal-kde-5.24.5-screencast-stop-stream-actively.patch |
507 |
@@ -0,0 +1,28 @@ |
508 |
+From d74e7dce1d333107760a8ae8d2bdd7521d31a09f Mon Sep 17 00:00:00 2001 |
509 |
+From: Aleix Pol <aleixpol@×××.org> |
510 |
+Date: Sat, 28 May 2022 03:37:14 +0200 |
511 |
+Subject: [PATCH] screencast: When we stop a stream, do it actively |
512 |
+ |
513 |
+We were just forgetting about it. |
514 |
+ |
515 |
+ |
516 |
+(cherry picked from commit aa531bde14a13521f99ae8e44d6e83bc8749d761) |
517 |
+--- |
518 |
+ src/waylandintegration.cpp | 1 + |
519 |
+ 1 file changed, 1 insertion(+) |
520 |
+ |
521 |
+diff --git a/src/waylandintegration.cpp b/src/waylandintegration.cpp |
522 |
+index b1b2d4d..44d862a 100644 |
523 |
+--- a/src/waylandintegration.cpp |
524 |
++++ b/src/waylandintegration.cpp |
525 |
+@@ -328,6 +328,7 @@ void WaylandIntegration::WaylandIntegrationPrivate::stopStreaming(uint32_t nodei |
526 |
+ { |
527 |
+ for (auto it = m_streams.begin(), itEnd = m_streams.end(); it != itEnd; ++it) { |
528 |
+ if (it->nodeId == nodeid) { |
529 |
++ it->close(); |
530 |
+ m_streams.erase(it); |
531 |
+ break; |
532 |
+ } |
533 |
+-- |
534 |
+GitLab |
535 |
+ |
536 |
|
537 |
diff --git a/kde-plasma/xdg-desktop-portal-kde/xdg-desktop-portal-kde-5.24.5-r2.ebuild b/kde-plasma/xdg-desktop-portal-kde/xdg-desktop-portal-kde-5.24.5-r2.ebuild |
538 |
new file mode 100644 |
539 |
index 000000000000..19da2f8c087b |
540 |
--- /dev/null |
541 |
+++ b/kde-plasma/xdg-desktop-portal-kde/xdg-desktop-portal-kde-5.24.5-r2.ebuild |
542 |
@@ -0,0 +1,51 @@ |
543 |
+# Copyright 1999-2022 Gentoo Authors |
544 |
+# Distributed under the terms of the GNU General Public License v2 |
545 |
+ |
546 |
+EAPI=8 |
547 |
+ |
548 |
+KFMIN=5.90.0 |
549 |
+PVCUT=$(ver_cut 1-3) |
550 |
+QTMIN=5.15.2 |
551 |
+inherit ecm kde.org |
552 |
+ |
553 |
+DESCRIPTION="Backend implementation for xdg-desktop-portal that is using Qt/KDE Frameworks" |
554 |
+ |
555 |
+LICENSE="LGPL-2+" |
556 |
+SLOT="5" |
557 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86" |
558 |
+IUSE="" |
559 |
+ |
560 |
+COMMON_DEPEND=" |
561 |
+ >=dev-libs/wayland-1.15 |
562 |
+ >=dev-qt/qtdbus-${QTMIN}:5 |
563 |
+ >=dev-qt/qtdeclarative-${QTMIN}:5 |
564 |
+ >=dev-qt/qtgui-${QTMIN}:5 |
565 |
+ >=dev-qt/qtprintsupport-${QTMIN}:5[cups] |
566 |
+ >=dev-qt/qtwidgets-${QTMIN}:5 |
567 |
+ >=kde-frameworks/kcoreaddons-${KFMIN}:5 |
568 |
+ >=kde-frameworks/kconfig-${KFMIN}:5 |
569 |
+ >=kde-frameworks/kdeclarative-${KFMIN}:5 |
570 |
+ >=kde-frameworks/ki18n-${KFMIN}:5 |
571 |
+ >=kde-frameworks/kio-${KFMIN}:5 |
572 |
+ >=kde-frameworks/kirigami-${KFMIN}:5 |
573 |
+ >=kde-frameworks/knotifications-${KFMIN}:5 |
574 |
+ >=kde-frameworks/kwidgetsaddons-${KFMIN}:5 |
575 |
+ >=kde-frameworks/kwindowsystem-${KFMIN}:5 |
576 |
+ >=kde-frameworks/kwayland-${KFMIN}:5 |
577 |
+ >=kde-frameworks/plasma-${KFMIN}:5 |
578 |
+" |
579 |
+DEPEND="${COMMON_DEPEND} |
580 |
+ >=dev-libs/plasma-wayland-protocols-1.1.1 |
581 |
+ >=dev-qt/qtconcurrent-${QTMIN}:5 |
582 |
+" |
583 |
+RDEPEND="${COMMON_DEPEND} |
584 |
+ sys-apps/xdg-desktop-portal |
585 |
+" |
586 |
+BDEPEND=">=dev-qt/qtwaylandscanner-${QTMIN}:5" |
587 |
+ |
588 |
+PATCHES=( |
589 |
+ "${FILESDIR}/${P}-show-screenshare-notifier-more-prominently.patch" # KDE-bug 452980 |
590 |
+ "${FILESDIR}/${P}-screencast-stop-stream-actively.patch" |
591 |
+ "${FILESDIR}/${P}-screencast-dont-provide-every-running-stream.patch" |
592 |
+ "${FILESDIR}/${P}-screencast-close-only-streams-of-closing-session.patch" |
593 |
+) |