diff options
author | Vaxry <[email protected]> | 2023-12-05 20:04:53 +0000 |
---|---|---|
committer | Vaxry <[email protected]> | 2023-12-05 20:04:53 +0000 |
commit | ab66fa430efd1e8b9b6a0220b896998215fff8c3 (patch) | |
tree | 318f11e0b030cebc82a46c5ce1a77bd7f56cccdd | |
parent | 37d7a8c64dfabfe81330c819c24fd6b13b292194 (diff) | |
download | Hyprland-ab66fa430efd1e8b9b6a0220b896998215fff8c3.tar.gz Hyprland-ab66fa430efd1e8b9b6a0220b896998215fff8c3.zip |
screencopy: fix glReadPixels offset
fixes #4042
-rw-r--r-- | src/protocols/Screencopy.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/protocols/Screencopy.cpp b/src/protocols/Screencopy.cpp index 8537a701..18fe09f4 100644 --- a/src/protocols/Screencopy.cpp +++ b/src/protocols/Screencopy.cpp @@ -481,11 +481,11 @@ bool CScreencopyProtocolManager::copyFrameShm(SScreencopyFrame* frame, timespec* uint32_t packStride = pixel_format_info_min_stride(drmFmtWlr, frame->box.w); if (packStride == stride) { - glReadPixels(frame->box.x, frame->box.y, frame->box.w, frame->box.h, PFORMAT->glFormat, PFORMAT->glType, data); + glReadPixels(0, 0, frame->box.w, frame->box.h, PFORMAT->glFormat, PFORMAT->glType, data); } else { for (size_t i = 0; i < frame->box.h; ++i) { - uint32_t y = frame->box.x + i; - glReadPixels(frame->box.x, y, frame->box.w, 1, PFORMAT->glFormat, PFORMAT->glType, ((unsigned char*)data) + i * stride); + uint32_t y = i; + glReadPixels(0, y, frame->box.w, 1, PFORMAT->glFormat, PFORMAT->glType, ((unsigned char*)data) + i * stride); } } |