Fixed damaging multimon

This commit is contained in:
vaxerski 2022-04-23 23:53:12 +02:00
parent fa38dfd416
commit fc14157d76

View File

@ -444,24 +444,26 @@ void CHyprRenderer::damageSurface(wlr_surface* pSurface, double x, double y) {
}
void CHyprRenderer::damageWindow(CWindow* pWindow) {
const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID);
if (!pWindow->m_bIsFloating) {
// damage by size & pos
// TODO TEMP: revise when added shadows/etc
wlr_box damageBox = {pWindow->m_vPosition.x, pWindow->m_vPosition.y, pWindow->m_vSize.x, pWindow->m_vSize.y};
wlr_box damageBox = {pWindow->m_vPosition.x - PMONITOR->vecPosition.x, pWindow->m_vPosition.y - PMONITOR->vecPosition.y, pWindow->m_vSize.x, pWindow->m_vSize.y};
for (auto& m : g_pCompositor->m_lMonitors)
wlr_output_damage_add_box(m.damage, &damageBox);
} else {
// damage by real size & pos + border size * 2 (JIC)
const auto BORDERSIZE = g_pConfigManager->getInt("general:border_size");
wlr_box damageBox = { pWindow->m_vRealPosition.x - BORDERSIZE - 1, pWindow->m_vRealPosition.y - BORDERSIZE - 1, pWindow->m_vRealSize.x + 2 * BORDERSIZE + 2, pWindow->m_vRealSize.y + 2 * BORDERSIZE + 2};
wlr_box damageBox = { pWindow->m_vRealPosition.x - BORDERSIZE - 1 - PMONITOR->vecPosition.x, pWindow->m_vRealPosition.y - BORDERSIZE - 1 - PMONITOR->vecPosition.y, pWindow->m_vRealSize.x + 2 * BORDERSIZE + 2, pWindow->m_vRealSize.y + 2 * BORDERSIZE + 2};
for (auto& m : g_pCompositor->m_lMonitors)
wlr_output_damage_add_box(m.damage, &damageBox);
}
}
void CHyprRenderer::damageMonitor(SMonitor* pMonitor) {
wlr_box damageBox = {pMonitor->vecPosition.x, pMonitor->vecPosition.y, pMonitor->vecSize.x, pMonitor->vecSize.y};
wlr_box damageBox = {0, 0, pMonitor->vecSize.x, pMonitor->vecSize.y};
scaleBox(&damageBox, pMonitor->scale);
wlr_output_damage_add_box(pMonitor->damage, &damageBox);
}