diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2023-07-19 20:09:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-19 20:09:49 +0200 |
| commit | 89b87158dbf100e4177f4a010190ba5f80252eb2 (patch) | |
| tree | cacff8d4257c0e4a1f95937c969075df0b07c280 /src/protocols/Screencopy.cpp | |
| parent | ce9896204a2ab1eb4f8960d44b876cbc9d0955ac (diff) | |
internal: Wrap regions (#2750)
Diffstat (limited to 'src/protocols/Screencopy.cpp')
| -rw-r--r-- | src/protocols/Screencopy.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/protocols/Screencopy.cpp b/src/protocols/Screencopy.cpp index 801b4615..c93bd5f7 100644 --- a/src/protocols/Screencopy.cpp +++ b/src/protocols/Screencopy.cpp @@ -403,17 +403,15 @@ void CScreencopyProtocolManager::sendFrameDamage(SScreencopyFrame* frame) { if (!frame->withDamage) return; - PIXMAN_DAMAGE_FOREACH(&frame->pMonitor->lastFrameDamage) { - const auto RECT = &RECTSARR[i]; + for (auto& RECT : frame->pMonitor->lastFrameDamage.getRects()) { - if (frame->buffer->width < 1 || frame->buffer->height < 1 || frame->buffer->width - RECT->x1 < 1 || frame->buffer->height - RECT->y1 < 1) { + if (frame->buffer->width < 1 || frame->buffer->height < 1 || frame->buffer->width - RECT.x1 < 1 || frame->buffer->height - RECT.y1 < 1) { Debug::log(ERR, "[sc] Failed to send damage"); break; } - 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)); + 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)); } } |
