Commit c3f9aab3 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

plugins/screencast: Allow including cursor in window screencasts

BUG: 452960
parent 1a475a73
Pipeline #215610 passed with stage
in 26 minutes and 38 seconds
......@@ -32,8 +32,7 @@ namespace KWin
ScreencastManager::ScreencastManager()
: m_screencast(new KWaylandServer::ScreencastV1Interface(waylandServer()->display(), this))
{
connect(m_screencast, &KWaylandServer::ScreencastV1Interface::windowScreencastRequested,
this, &ScreencastManager::streamWindow);
connect(m_screencast, &KWaylandServer::ScreencastV1Interface::windowScreencastRequested, this, &ScreencastManager::streamWindow);
connect(m_screencast, &KWaylandServer::ScreencastV1Interface::outputScreencastRequested, this, &ScreencastManager::streamWaylandOutput);
connect(m_screencast, &KWaylandServer::ScreencastV1Interface::virtualOutputScreencastRequested, this, &ScreencastManager::streamVirtualOutput);
connect(m_screencast, &KWaylandServer::ScreencastV1Interface::regionScreencastRequested, this, &ScreencastManager::streamRegion);
......@@ -84,7 +83,9 @@ private:
Window *m_window;
};
void ScreencastManager::streamWindow(KWaylandServer::ScreencastStreamV1Interface *waylandStream, const QString &winid)
void ScreencastManager::streamWindow(KWaylandServer::ScreencastStreamV1Interface *waylandStream,
const QString &winid,
KWaylandServer::ScreencastV1Interface::CursorMode mode)
{
auto window = Workspace::self()->findToplevel(QUuid(winid));
if (!window) {
......@@ -93,6 +94,13 @@ void ScreencastManager::streamWindow(KWaylandServer::ScreencastStreamV1Interface
}
auto stream = new WindowStream(window, this);
stream->setCursorMode(mode, 1, window->clientGeometry().toRect());
if (mode != KWaylandServer::ScreencastV1Interface::CursorMode::Hidden) {
connect(window, &Window::clientGeometryChanged, stream, [window, stream, mode]() {
stream->setCursorMode(mode, 1, window->clientGeometry().toRect());
});
}
integrateStreams(waylandStream, stream);
}
......
......@@ -25,7 +25,9 @@ public:
explicit ScreencastManager();
private:
void streamWindow(KWaylandServer::ScreencastStreamV1Interface *stream, const QString &winid);
void streamWindow(KWaylandServer::ScreencastStreamV1Interface *stream,
const QString &winid,
KWaylandServer::ScreencastV1Interface::CursorMode mode);
void streamWaylandOutput(KWaylandServer::ScreencastStreamV1Interface *stream,
KWaylandServer::OutputInterface *output,
KWaylandServer::ScreencastV1Interface::CursorMode mode);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment