From 89b87158dbf100e4177f4a010190ba5f80252eb2 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Wed, 19 Jul 2023 20:09:49 +0200 Subject: internal: Wrap regions (#2750) --- src/protocols/ToplevelExport.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/protocols/ToplevelExport.cpp') diff --git a/src/protocols/ToplevelExport.cpp b/src/protocols/ToplevelExport.cpp index 180b1489..eeeaa81f 100644 --- a/src/protocols/ToplevelExport.cpp +++ b/src/protocols/ToplevelExport.cpp @@ -347,16 +347,14 @@ bool CToplevelExportProtocolManager::copyFrameShm(SScreencopyFrame* frame, times return false; // render the client - const auto PMONITOR = g_pCompositor->getMonitorFromID(frame->pWindow->m_iMonitorID); - pixman_region32_t fakeDamage; - pixman_region32_init_rect(&fakeDamage, 0, 0, PMONITOR->vecPixelSize.x * 10, PMONITOR->vecPixelSize.y * 10); + const auto PMONITOR = g_pCompositor->getMonitorFromID(frame->pWindow->m_iMonitorID); + CRegion fakeDamage{0, 0, PMONITOR->vecPixelSize.x * 10, PMONITOR->vecPixelSize.y * 10}; if (frame->overlayCursor) wlr_output_lock_software_cursors(PMONITOR->output, true); if (!wlr_output_attach_render(PMONITOR->output, nullptr)) { Debug::log(ERR, "[toplevel_export] Couldn't attach render"); - pixman_region32_fini(&fakeDamage); wlr_buffer_end_data_ptr_access(frame->buffer); if (frame->overlayCursor) wlr_output_lock_software_cursors(PMONITOR->output, false); @@ -398,7 +396,6 @@ bool CToplevelExportProtocolManager::copyFrameShm(SScreencopyFrame* frame, times if (!PFORMAT) { Debug::log(ERR, "[toplevel_export] Cannot read pixels, unsupported format %lx", PFORMAT); g_pHyprOpenGL->end(); - pixman_region32_fini(&fakeDamage); wlr_buffer_end_data_ptr_access(frame->buffer); if (frame->overlayCursor) wlr_output_lock_software_cursors(PMONITOR->output, false); @@ -415,8 +412,6 @@ bool CToplevelExportProtocolManager::copyFrameShm(SScreencopyFrame* frame, times wlr_output_rollback(PMONITOR->output); - pixman_region32_fini(&fakeDamage); - wlr_buffer_end_data_ptr_access(frame->buffer); if (frame->overlayCursor) -- cgit v1.2.3