diff options
| author | Kamikadze <40305144+Kam1k4dze@users.noreply.github.com> | 2025-06-08 12:19:23 +0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-08 08:19:23 +0100 |
| commit | c6f713fefe59c8c51783210dad6b68586f248de2 (patch) | |
| tree | b5f31161a66131b2f346dba762d9177573167a38 /src/protocols/Screencopy.cpp | |
| parent | 91967f8ec05b69240382640d01e303ecf47a9404 (diff) | |
screencopy: fix incorrect noscreenshare positions with monitor scaling (#10674)
Diffstat (limited to 'src/protocols/Screencopy.cpp')
| -rw-r--r-- | src/protocols/Screencopy.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/protocols/Screencopy.cpp b/src/protocols/Screencopy.cpp index 41bac3c8..53c27c81 100644 --- a/src/protocols/Screencopy.cpp +++ b/src/protocols/Screencopy.cpp @@ -216,15 +216,15 @@ void CScreencopyFrame::renderMon() { const auto REALPOS = w->m_realPosition->value() + (w->m_pinned ? Vector2D{} : PWORKSPACE->m_renderOffset->value()); const auto noScreenShareBox = CBox{REALPOS.x, REALPOS.y, std::max(w->m_realSize->value().x, 5.0), std::max(w->m_realSize->value().y, 5.0)} + .translate(-m_monitor->m_position) .scale(m_monitor->m_scale) - .translate({-m_monitor->m_position.x, -m_monitor->m_position.y}) - .translate({-m_box.x, -m_box.y}); + .translate(-m_box.pos()); const auto dontRound = w->isEffectiveInternalFSMode(FSMODE_FULLSCREEN) || w->m_windowData.noRounding.valueOrDefault(); const auto rounding = dontRound ? 0 : w->rounding() * m_monitor->m_scale; const auto roundingPower = dontRound ? 2.0f : w->roundingPower(); - g_pHyprOpenGL->renderRect(noScreenShareBox, {0, 0, 0, 255}, rounding, roundingPower); + g_pHyprOpenGL->renderRect(noScreenShareBox, Colors::BLACK, rounding, roundingPower); if (w->m_isX11 || !w->m_popupHead) continue; @@ -241,13 +241,10 @@ void CScreencopyFrame::renderMon() { popup->m_wlSurface->resource()->breadthfirst( [&](SP<CWLSurfaceResource> surf, const Vector2D& localOff, void*) { const auto size = surf->m_current.size; - const auto surfBox = CBox{popupBaseOffset.x + popRel.x + localOff.x, popupBaseOffset.y + popRel.y + localOff.y, size.x, size.y} - .scale(m_monitor->m_scale) - .translate({-m_monitor->m_position.x, -m_monitor->m_position.y}) - .translate({-m_box.x, -m_box.y}); + const auto surfBox = CBox{popupBaseOffset + popRel + localOff, size}.translate(-m_monitor->m_position).scale(m_monitor->m_scale).translate(-m_box.pos()); if LIKELY (surfBox.w > 0 && surfBox.h > 0) - g_pHyprOpenGL->renderRect(surfBox, {0, 0, 0, 255}); + g_pHyprOpenGL->renderRect(surfBox, Colors::BLACK); }, nullptr); }, |
