diff options
Diffstat (limited to 'src/protocols/core/Compositor.cpp')
| -rw-r--r-- | src/protocols/core/Compositor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/protocols/core/Compositor.cpp b/src/protocols/core/Compositor.cpp index 10b554f6..bbb76cb2 100644 --- a/src/protocols/core/Compositor.cpp +++ b/src/protocols/core/Compositor.cpp @@ -606,14 +606,14 @@ void CWLSurfaceResource::updateCursorShm(CRegion damage) { if (const auto RECTS = damage.getRects(); RECTS.size() == 1 && RECTS.at(0).x2 == buf->size.x && RECTS.at(0).y2 == buf->size.y) memcpy(shmData.data(), pixelData, bufLen); else { - for (auto& box : damage.getRects()) { + damage.forEachRect([&pixelData, &shmData](const auto& box) { for (auto y = box.y1; y < box.y2; ++y) { // bpp is 32 INSALLAH auto begin = 4 * box.y1 * (box.x2 - box.x1) + box.x1; auto len = 4 * (box.x2 - box.x1); memcpy((uint8_t*)shmData.data() + begin, (uint8_t*)pixelData + begin, len); } - } + }); } } |
