Commit 8f2ba3ef authored by David Edmundson's avatar David Edmundson Committed by Vlad Zahorodnii
Browse files

Make openGL context current when recording frame triggered by cursor move

recordFrame requires an openGL context. This is typically done after a
frame is rendered, but when we send a frame after a cursor move this is
not guaranteed.

BUG: 448162


(cherry picked from commit 12427932)
parent 78c483ab
Pipeline #136051 passed with stage
in 14 minutes and 26 seconds
......@@ -8,6 +8,7 @@
#include "screencaststream.h"
#include "cursor.h"
#include "composite.h"
#include "dmabuftexture.h"
#include "eglnativefence.h"
#include "kwinglplatform.h"
......@@ -17,6 +18,7 @@
#include "main.h"
#include "pipewirecore.h"
#include "platform.h"
#include "scene.h"
#include "screencastsource.h"
#include "utils/common.h"
......@@ -302,6 +304,9 @@ bool ScreenCastStream::createStream()
if (m_cursor.mode == KWaylandServer::ScreencastV1Interface::Embedded) {
connect(Cursors::self(), &Cursors::positionChanged, this, [this] {
if (auto scene = Compositor::self()->scene()) {
scene->makeOpenGLContextCurrent();
}
recordFrame(QRegion{m_cursor.lastRect} | cursorGeometry(Cursors::self()->currentCursor()));
});
} else if (m_cursor.mode == KWaylandServer::ScreencastV1Interface::Metadata) {
......
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