From fe54dcb4eb80496ba377efb21eb3edf1ee20ee62 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 10 Jul 2023 13:17:21 +0200 Subject: [PATCH] screencopy: send original damage, avoid extents --- src/protocols/Screencopy.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/protocols/Screencopy.cpp b/src/protocols/Screencopy.cpp index 60b1273e6..d79a3473e 100644 --- a/src/protocols/Screencopy.cpp +++ b/src/protocols/Screencopy.cpp @@ -407,9 +407,11 @@ void CScreencopyProtocolManager::sendFrameDamage(SScreencopyFrame* frame) { if (!frame->withDamage) return; - const auto RECT = pixman_region32_extents(g_pHyprOpenGL->m_RenderData.pDamage); - zwlr_screencopy_frame_v1_send_damage(frame->resource, std::clamp(RECT->x1, 0, frame->buffer->width), std::clamp(RECT->y1, 0, frame->buffer->height), + PIXMAN_DAMAGE_FOREACH(&g_pHyprOpenGL->m_rOriginalDamageRegion) { + const auto RECT = &RECTSARR[i]; + zwlr_screencopy_frame_v1_send_damage(frame->resource, std::clamp(RECT->x1, 0, frame->buffer->width), std::clamp(RECT->y1, 0, frame->buffer->height), std::clamp(RECT->x2 - RECT->x1, 0, frame->buffer->width - RECT->x1), std::clamp(RECT->y2 - RECT->y1, 0, frame->buffer->height - RECT->y1)); + } } bool CScreencopyProtocolManager::copyFrameShm(SScreencopyFrame* frame, timespec* now) {