screencopy: fix shm sharing if introspection required

This commit is contained in:
Vaxry 2023-11-30 11:07:17 +00:00
parent 9f2027be4b
commit 12ec549a18

View file

@ -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);