diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2025-06-28 17:01:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-28 17:01:14 +0200 |
| commit | ab900d8752af11ada256ea6fca54d5404587405c (patch) | |
| tree | d0a0de263e799b97a972192cf2eb5989d7401505 /src/protocols/Screencopy.cpp | |
| parent | 0fea173fc8fc40dbb59b57fc42c03ca2d67d9a8d (diff) | |
screencopy: fix improper box calculations for transforms (#10870)
Diffstat (limited to 'src/protocols/Screencopy.cpp')
| -rw-r--r-- | src/protocols/Screencopy.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/protocols/Screencopy.cpp b/src/protocols/Screencopy.cpp index 052710ce..bcfe1aa0 100644 --- a/src/protocols/Screencopy.cpp +++ b/src/protocols/Screencopy.cpp @@ -63,11 +63,13 @@ CScreencopyFrame::CScreencopyFrame(SP<CZwlrScreencopyFrameV1> resource_, int32_t if (box_.width == 0 && box_.height == 0) m_box = {0, 0, (int)(m_monitor->m_size.x), (int)(m_monitor->m_size.y)}; - else { + else m_box = box_; - } - m_box.transform(wlTransformToHyprutils(m_monitor->m_transform), m_monitor->m_transformedSize.x, m_monitor->m_transformedSize.y).scale(m_monitor->m_scale).round(); + const auto POS = m_box.pos(); + m_box.transform(wlTransformToHyprutils(m_monitor->m_transform), m_monitor->m_pixelSize.x, m_monitor->m_pixelSize.y).scale(m_monitor->m_scale).round(); + m_box.x = POS.x; + m_box.y = POS.y; m_shmStride = NFormatUtils::minStride(PSHMINFO, m_box.w); |
