mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-02 01:46:01 +01:00
screencopy: clamp damage to framebuffer
This commit is contained in:
parent
1a91c6ee60
commit
eb570c88e6
1 changed files with 2 additions and 1 deletions
|
@ -409,7 +409,8 @@ void CScreencopyProtocolManager::sendFrameDamage(SScreencopyFrame* frame) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const auto RECT = pixman_region32_extents(g_pHyprOpenGL->m_RenderData.pDamage);
|
const auto RECT = pixman_region32_extents(g_pHyprOpenGL->m_RenderData.pDamage);
|
||||||
zwlr_screencopy_frame_v1_send_damage(frame->resource, RECT->x1, RECT->y1, RECT->x2 - RECT->x1, RECT->y2 - RECT->y1);
|
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) {
|
bool CScreencopyProtocolManager::copyFrameShm(SScreencopyFrame* frame, timespec* now) {
|
||||||
|
|
Loading…
Reference in a new issue