mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-30 02:05:58 +01:00
Fixed damaging multimon
This commit is contained in:
parent
fa38dfd416
commit
fc14157d76
1 changed files with 5 additions and 3 deletions
|
@ -444,24 +444,26 @@ void CHyprRenderer::damageSurface(wlr_surface* pSurface, double x, double y) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHyprRenderer::damageWindow(CWindow* pWindow) {
|
void CHyprRenderer::damageWindow(CWindow* pWindow) {
|
||||||
|
const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID);
|
||||||
|
|
||||||
if (!pWindow->m_bIsFloating) {
|
if (!pWindow->m_bIsFloating) {
|
||||||
// damage by size & pos
|
// damage by size & pos
|
||||||
// TODO TEMP: revise when added shadows/etc
|
// 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)
|
for (auto& m : g_pCompositor->m_lMonitors)
|
||||||
wlr_output_damage_add_box(m.damage, &damageBox);
|
wlr_output_damage_add_box(m.damage, &damageBox);
|
||||||
} else {
|
} else {
|
||||||
// damage by real size & pos + border size * 2 (JIC)
|
// damage by real size & pos + border size * 2 (JIC)
|
||||||
const auto BORDERSIZE = g_pConfigManager->getInt("general:border_size");
|
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)
|
for (auto& m : g_pCompositor->m_lMonitors)
|
||||||
wlr_output_damage_add_box(m.damage, &damageBox);
|
wlr_output_damage_add_box(m.damage, &damageBox);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHyprRenderer::damageMonitor(SMonitor* pMonitor) {
|
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);
|
scaleBox(&damageBox, pMonitor->scale);
|
||||||
wlr_output_damage_add_box(pMonitor->damage, &damageBox);
|
wlr_output_damage_add_box(pMonitor->damage, &damageBox);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue