renderer: add "noscreenshare" layer rule (#11664)

This commit is contained in:
0xFMD 2025-09-22 14:26:14 +03:00 committed by GitHub
parent 45f007d412
commit 26f293523a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 27 additions and 2 deletions

View file

@ -211,6 +211,22 @@ void CScreencopyFrame::renderMon() {
g_pHyprOpenGL->setRenderModifEnabled(true);
g_pHyprOpenGL->popMonitorTransformEnabled();
for (auto const& l : g_pCompositor->m_layers) {
if (!l->m_noScreenShare)
continue;
if UNLIKELY ((!l->m_mapped && !l->m_fadingOut) || l->m_alpha->value() == 0.f)
continue;
const auto REALPOS = l->m_realPosition->value();
const auto REALSIZE = l->m_realSize->value();
const auto noScreenShareBox =
CBox{REALPOS.x, REALPOS.y, std::max(REALSIZE.x, 5.0), std::max(REALSIZE.y, 5.0)}.translate(-m_monitor->m_position).scale(m_monitor->m_scale).translate(-m_box.pos());
g_pHyprOpenGL->renderRect(noScreenShareBox, Colors::BLACK, {});
}
for (auto const& w : g_pCompositor->m_windows) {
if (!w->m_windowData.noScreenShare.valueOrDefault())
continue;