screencast: Move creation of the global to manager

We want to turn screencasting into a plugin eventually.
master
Vlad Zahorodnii 2020-07-27 14:05:52 +03:00 committed by Vlad Zahorodnii
parent 4eda4d2b5d
commit 5a73f4a350
4 changed files with 8 additions and 11 deletions

View File

@ -27,6 +27,7 @@
#include "plugins/scenes/opengl/scene_opengl.h"
#include "pipewirestream.h"
#include <KWaylandServer/display.h>
#include <KWaylandServer/output_interface.h>
#include <KLocalizedString>
#include <abstract_client.h>
@ -37,9 +38,12 @@ using namespace KWin;
ScreencastManager::ScreencastManager(QObject *parent)
: QObject(parent)
, m_screencast(waylandServer()->display()->createScreencastInterface(this))
{
connect(waylandServer()->screencast(), &KWaylandServer::ScreencastInterface::windowScreencastRequested, this, &ScreencastManager::streamWindow);
connect(waylandServer()->screencast(), &KWaylandServer::ScreencastInterface::outputScreencastRequested, this, &ScreencastManager::streamOutput);
connect(m_screencast, &KWaylandServer::ScreencastInterface::windowScreencastRequested,
this, &ScreencastManager::streamWindow);
connect(m_screencast, &KWaylandServer::ScreencastInterface::outputScreencastRequested,
this, &ScreencastManager::streamOutput);
}
class EGLFence : public QObject
{

View File

@ -45,5 +45,7 @@ public:
private:
void integrateStreams(KWaylandServer::ScreencastStreamInterface *waylandStream, PipeWireStream *pipewireStream);
KWaylandServer::ScreencastInterface *m_screencast;
};

View File

@ -458,10 +458,6 @@ bool WaylandServer::init(const QByteArray &socketName, InitializationFlags flags
m_keyState = m_display->createKeyStateInterface(m_display);
m_keyState->create();
#ifdef PipeWire_FOUND
m_screencast = m_display->createScreencastInterface(m_display);
#endif
return true;
}

View File

@ -69,7 +69,6 @@ class LinuxDmabufUnstableV1Buffer;
class TabletManagerInterface;
class KeyboardShortcutsInhibitManagerV1Interface;
class XdgDecorationManagerV1Interface;
class ScreencastInterface;
}
@ -128,9 +127,6 @@ public:
{
return m_windowManagement;
}
KWaylandServer::ScreencastInterface *screencast() {
return m_screencast;
}
KWaylandServer::ServerSideDecorationManagerInterface *decorationManager() const {
return m_decorationManager;
}
@ -285,7 +281,6 @@ private:
KWaylandServer::LinuxDmabufUnstableV1Interface *m_linuxDmabuf = nullptr;
KWaylandServer::KeyboardShortcutsInhibitManagerV1Interface *m_keyboardShortcutsInhibitManager = nullptr;
QSet<KWaylandServer::LinuxDmabufUnstableV1Buffer*> m_linuxDmabufBuffers;
KWaylandServer::ScreencastInterface *m_screencast = nullptr;
struct {
KWaylandServer::ClientConnection *client = nullptr;
QMetaObject::Connection destroyConnection;