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 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); },