Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] kwin: fix screencast
@ 2024-05-14 17:18 Luciogi
  2024-05-14 18:23 ` [PR REVIEW] " classabbyamp
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Luciogi @ 2024-05-14 17:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 489 bytes --]

There is a new pull request by Luciogi against master on the void-packages repository

https://github.com/Luciogi/void-packages kwin
https://github.com/void-linux/void-packages/pull/50341

kwin: fix screencast

#### Testing the changes
- I tested the changes in this PR: **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-GLIBC)

fixes #50326 


A patch file from https://github.com/void-linux/void-packages/pull/50341.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-kwin-50341.patch --]
[-- Type: text/x-diff, Size: 6319 bytes --]

From 5fa57f0d8fd70ce9cf056e78f6224eadffc81bd3 Mon Sep 17 00:00:00 2001
From: Luciogi <lucigithubcommit@skiff.com>
Date: Tue, 14 May 2024 22:13:16 +0500
Subject: [PATCH] kwin: fix screencast

---
 .../kwin/patches/screencast-pipewire.patch    | 130 ++++++++++++++++++
 srcpkgs/kwin/template                         |   2 +-
 2 files changed, 131 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/kwin/patches/screencast-pipewire.patch

diff --git a/srcpkgs/kwin/patches/screencast-pipewire.patch b/srcpkgs/kwin/patches/screencast-pipewire.patch
new file mode 100644
index 00000000000000..a12ac2d78978c1
--- /dev/null
+++ b/srcpkgs/kwin/patches/screencast-pipewire.patch
@@ -0,0 +1,130 @@
+diff --git a/src/plugins/screencast/pipewirecore.cpp b/src/plugins/screencast/pipewirecore.cpp
+index 077854c65ee5d7764d9681095cb093244251e808..085d0595372b4b4005c19596a56da58bd53d52ef 100644
+--- a/src/plugins/screencast/pipewirecore.cpp
++++ b/src/plugins/screencast/pipewirecore.cpp
+@@ -48,6 +48,7 @@ void PipeWireCore::onCoreError(void *data, uint32_t id, int seq, int res, const
+     qCWarning(KWIN_SCREENCAST) << "PipeWire remote error: " << message;
+     if (id == PW_ID_CORE && res == -EPIPE) {
+         PipeWireCore *pw = static_cast<PipeWireCore *>(data);
++        pw->m_valid = false;
+         Q_EMIT pw->pipewireFailed(QString::fromUtf8(message));
+     }
+ }
+@@ -91,9 +92,15 @@ bool PipeWireCore::init()
+     }
+ 
+     pw_core_add_listener(pwCore, &coreListener, &pwCoreEvents, this);
++    m_valid = true;
+     return true;
+ }
+ 
++bool PipeWireCore::isValid() const
++{
++    return m_valid;
++}
++
+ } // namespace KWin
+ 
+ #include "moc_pipewirecore.cpp"
+diff --git a/src/plugins/screencast/pipewirecore.h b/src/plugins/screencast/pipewirecore.h
+index cb20ba8b52337594b8ed366e3173854438258fdf..f66dc0edb22a66008e4a8571f8ef80044ee45203 100644
+--- a/src/plugins/screencast/pipewirecore.h
++++ b/src/plugins/screencast/pipewirecore.h
+@@ -28,6 +28,7 @@ public:
+     ~PipeWireCore();
+ 
+     bool init();
++    bool isValid() const;
+ 
+     static std::shared_ptr<PipeWireCore> self();
+ 
+@@ -41,6 +42,9 @@ public:
+ 
+ Q_SIGNALS:
+     void pipewireFailed(const QString &message);
++
++private:
++    bool m_valid = false;
+ };
+ 
+ } // namespace KWin
+diff --git a/src/plugins/screencast/screencastmanager.cpp b/src/plugins/screencast/screencastmanager.cpp
+index 87c84e93f39b1707a60df43a208eeede3f507df6..e0b009c3b70a0a0b2eae1526b503cd75d85ac7cc 100644
+--- a/src/plugins/screencast/screencastmanager.cpp
++++ b/src/plugins/screencast/screencastmanager.cpp
+@@ -27,9 +27,9 @@ namespace KWin
+ 
+ ScreencastManager::ScreencastManager()
+     : m_screencast(new ScreencastV1Interface(waylandServer()->display(), this))
+-    , m_core(new PipeWireCore)
+ {
+-    m_core->init();
++    getPipewireConnection();
++
+     connect(m_screencast, &ScreencastV1Interface::windowScreencastRequested, this, &ScreencastManager::streamWindow);
+     connect(m_screencast, &ScreencastV1Interface::outputScreencastRequested, this, &ScreencastManager::streamWaylandOutput);
+     connect(m_screencast, &ScreencastV1Interface::virtualOutputScreencastRequested, this, &ScreencastManager::streamVirtualOutput);
+@@ -46,7 +46,7 @@ void ScreencastManager::streamWindow(ScreencastStreamV1Interface *waylandStream,
+         return;
+     }
+ 
+-    auto stream = new ScreenCastStream(new WindowScreenCastSource(window), m_core, this);
++    auto stream = new ScreenCastStream(new WindowScreenCastSource(window), getPipewireConnection(), this);
+     stream->setObjectName(window->desktopFileName());
+     stream->setCursorMode(mode, 1, window->clientGeometry());
+ 
+@@ -88,7 +88,7 @@ void ScreencastManager::streamOutput(ScreencastStreamV1Interface *waylandStream,
+         return;
+     }
+ 
+-    auto stream = new ScreenCastStream(new OutputScreenCastSource(streamOutput), m_core, this);
++    auto stream = new ScreenCastStream(new OutputScreenCastSource(streamOutput), getPipewireConnection(), this);
+     stream->setObjectName(streamOutput->name());
+     stream->setCursorMode(mode, streamOutput->scale(), streamOutput->geometry());
+ 
+@@ -112,7 +112,7 @@ void ScreencastManager::streamRegion(ScreencastStreamV1Interface *waylandStream,
+     }
+ 
+     auto source = new RegionScreenCastSource(geometry, scale);
+-    auto stream = new ScreenCastStream(source, m_core, this);
++    auto stream = new ScreenCastStream(source, getPipewireConnection(), this);
+     stream->setObjectName(rectToString(geometry));
+     stream->setCursorMode(mode, scale, geometry);
+ 
+@@ -135,6 +135,20 @@ void ScreencastManager::integrateStreams(ScreencastStreamV1Interface *waylandStr
+     }
+ }
+ 
++std::shared_ptr<PipeWireCore> ScreencastManager::getPipewireConnection()
++{
++    if (m_pipewireConnectionCache && m_pipewireConnectionCache->isValid()) {
++        return m_pipewireConnectionCache;
++    } else {
++        std::shared_ptr<PipeWireCore> pipeWireCore = std::make_shared<PipeWireCore>();
++        if (pipeWireCore->init()) {
++            m_pipewireConnectionCache = pipeWireCore;
++        }
++        // return a valid object even if init fails
++        return pipeWireCore;
++    }
++}
++
+ } // namespace KWin
+ 
+ #include "moc_screencastmanager.cpp"
+diff --git a/src/plugins/screencast/screencastmanager.h b/src/plugins/screencast/screencastmanager.h
+index 059e64b545a8e4166bc40212b5bd11bb3000d2d2..436040dea9aac14d47176f106de8d8bcfd7a6048 100644
+--- a/src/plugins/screencast/screencastmanager.h
++++ b/src/plugins/screencast/screencastmanager.h
+@@ -46,8 +46,10 @@ private:
+ 
+     void integrateStreams(ScreencastStreamV1Interface *waylandStream, ScreenCastStream *stream);
+ 
++    std::shared_ptr<PipeWireCore> getPipewireConnection();
++
+     ScreencastV1Interface *m_screencast;
+-    std::shared_ptr<PipeWireCore> m_core;
++    std::shared_ptr<PipeWireCore> m_pipewireConnectionCache;
+ };
+ 
+ } // namespace KWin
diff --git a/srcpkgs/kwin/template b/srcpkgs/kwin/template
index 314bfd89467991..934c3735b6f80b 100644
--- a/srcpkgs/kwin/template
+++ b/srcpkgs/kwin/template
@@ -1,7 +1,7 @@
 # Template file for 'kwin'
 pkgname=kwin
 version=6.0.4
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 configure_args="-DBUILD_TESTING=OFF -DFORCE_CROSSCOMPILED_TOOLS=ON

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR REVIEW] kwin: fix screencast
  2024-05-14 17:18 [PR PATCH] kwin: fix screencast Luciogi
@ 2024-05-14 18:23 ` classabbyamp
  2024-05-14 18:23 ` classabbyamp
  2024-05-15  6:26 ` [PR PATCH] [Closed]: " sgn
  2 siblings, 0 replies; 4+ messages in thread
From: classabbyamp @ 2024-05-14 18:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 292 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/50341#discussion_r1600470674

Comment:
use the proper patch so we know where it's from: https://invent.kde.org/plasma/kwin/-/commit/013e69988ffdbed1d3c684a536c0d4b79c7de680.patch

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR REVIEW] kwin: fix screencast
  2024-05-14 17:18 [PR PATCH] kwin: fix screencast Luciogi
  2024-05-14 18:23 ` [PR REVIEW] " classabbyamp
@ 2024-05-14 18:23 ` classabbyamp
  2024-05-15  6:26 ` [PR PATCH] [Closed]: " sgn
  2 siblings, 0 replies; 4+ messages in thread
From: classabbyamp @ 2024-05-14 18:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 309 bytes --]

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/50341#discussion_r1600470674

Comment:
use the proper patch so we know where it's from and what it does: https://invent.kde.org/plasma/kwin/-/commit/013e69988ffdbed1d3c684a536c0d4b79c7de680.patch

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Closed]: kwin: fix screencast
  2024-05-14 17:18 [PR PATCH] kwin: fix screencast Luciogi
  2024-05-14 18:23 ` [PR REVIEW] " classabbyamp
  2024-05-14 18:23 ` classabbyamp
@ 2024-05-15  6:26 ` sgn
  2 siblings, 0 replies; 4+ messages in thread
From: sgn @ 2024-05-15  6:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 341 bytes --]

There's a closed pull request on the void-packages repository

kwin: fix screencast
https://github.com/void-linux/void-packages/pull/50341

Description:

#### Testing the changes
- I tested the changes in this PR: **YES**

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-GLIBC)

fixes #50326 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-15  6:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-14 17:18 [PR PATCH] kwin: fix screencast Luciogi
2024-05-14 18:23 ` [PR REVIEW] " classabbyamp
2024-05-14 18:23 ` classabbyamp
2024-05-15  6:26 ` [PR PATCH] [Closed]: " sgn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).