From 12ec549a183abd59779a294c2f5bca0e95e528c0 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Thu, 30 Nov 2023 11:07:17 +0000 Subject: [PATCH] screencopy: fix shm sharing if introspection required --- src/protocols/Screencopy.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/protocols/Screencopy.cpp b/src/protocols/Screencopy.cpp index 2e00a509..50528ca3 100644 --- a/src/protocols/Screencopy.cpp +++ b/src/protocols/Screencopy.cpp @@ -464,9 +464,15 @@ bool CScreencopyProtocolManager::copyFrameShm(SScreencopyFrame* frame, timespec* return false; } + g_pHyprRenderer->endRender(); + + g_pHyprRenderer->makeEGLCurrent(); + g_pHyprOpenGL->m_RenderData.pMonitor = frame->pMonitor; + fb.bind(); + glReadPixels(0, 0, frame->box.w, frame->box.h, PFORMAT->gl_format, PFORMAT->gl_type, data); - g_pHyprRenderer->endRender(); + g_pHyprOpenGL->m_RenderData.pMonitor = nullptr; wlr_buffer_end_data_ptr_access(frame->buffer); wlr_texture_destroy(sourceTex);