mirror of
https://github.com/hyprwm/Hyprland
synced 2025-12-24 10:30:02 +01:00
renderer: add damage to second monitor
if the buffer gets locked to another monitor add the intersecting region to monitor damage and schedule a frame.
This commit is contained in:
parent
07a6107786
commit
6aa69c766e
1 changed files with 16 additions and 1 deletions
|
|
@ -161,8 +161,23 @@ void CSurfacePassElement::draw(const CRegion& damage) {
|
||||||
if (!m)
|
if (!m)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (m_data.pMonitor == m || (m_data.pWindow && m_data.pWindow->visibleOnMonitor(m)))
|
if (m_data.pMonitor == m || (m_data.pWindow && m_data.pWindow->visibleOnMonitor(m))) {
|
||||||
g_pBufferReleaseManager->addBuffer(m, m_data.surface->m_current.buffer);
|
g_pBufferReleaseManager->addBuffer(m, m_data.surface->m_current.buffer);
|
||||||
|
|
||||||
|
if (m_data.pMonitor != m) {
|
||||||
|
CBox wbox = {m_data.pWindow->m_realPosition->value(), m_data.pWindow->m_realSize->value()};
|
||||||
|
if (m_data.pWindow->m_isFloating)
|
||||||
|
wbox = m_data.pWindow->getFullWindowBoundingBox();
|
||||||
|
|
||||||
|
CBox monbox = {m->m_position, m->m_size};
|
||||||
|
CBox damageBox = wbox.intersection(monbox);
|
||||||
|
|
||||||
|
if (!damageBox.empty()) {
|
||||||
|
m->addDamage(damageBox);
|
||||||
|
g_pCompositor->scheduleFrameForMonitor(m, Aquamarine::IOutput::AQ_SCHEDULE_NEEDS_FRAME);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue