mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-25 22:05:59 +01:00
monitor: don't damage twice (#4727)
When scaled, the ring is already fully damaged, no need to add the region damage. Also moved a variable that was being declared way to far for where it is actually used. Co-authored-by: Abilio Costa <abilio.costa@criticaltechworks.com>
This commit is contained in:
parent
fbf5ba87ce
commit
e3e7e1fdda
2 changed files with 3 additions and 5 deletions
|
@ -320,9 +320,7 @@ void CMonitor::addDamage(const pixman_region32_t* rg) {
|
||||||
if (*PZOOMFACTOR != 1.f && g_pCompositor->getMonitorFromCursor() == this) {
|
if (*PZOOMFACTOR != 1.f && g_pCompositor->getMonitorFromCursor() == this) {
|
||||||
wlr_damage_ring_add_whole(&damage);
|
wlr_damage_ring_add_whole(&damage);
|
||||||
g_pCompositor->scheduleFrameForMonitor(this);
|
g_pCompositor->scheduleFrameForMonitor(this);
|
||||||
}
|
} else if (wlr_damage_ring_add(&damage, rg))
|
||||||
|
|
||||||
if (wlr_damage_ring_add(&damage, rg))
|
|
||||||
g_pCompositor->scheduleFrameForMonitor(this);
|
g_pCompositor->scheduleFrameForMonitor(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1083,8 +1083,7 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
|
||||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||||
|
|
||||||
// check the damage
|
// check the damage
|
||||||
CRegion damage;
|
bool hasChanged = pMonitor->output->needs_frame || pixman_region32_not_empty(&pMonitor->damage.current);
|
||||||
bool hasChanged = pMonitor->output->needs_frame || pixman_region32_not_empty(&pMonitor->damage.current);
|
|
||||||
|
|
||||||
if (!hasChanged && *PDAMAGETRACKINGMODE != DAMAGE_TRACKING_NONE && pMonitor->forceFullFrames == 0 && damageBlinkCleanup == 0)
|
if (!hasChanged && *PDAMAGETRACKINGMODE != DAMAGE_TRACKING_NONE && pMonitor->forceFullFrames == 0 && damageBlinkCleanup == 0)
|
||||||
return;
|
return;
|
||||||
|
@ -1100,6 +1099,7 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
|
||||||
if (UNLOCK_SC)
|
if (UNLOCK_SC)
|
||||||
wlr_output_lock_software_cursors(pMonitor->output, true);
|
wlr_output_lock_software_cursors(pMonitor->output, true);
|
||||||
|
|
||||||
|
CRegion damage;
|
||||||
wlr_damage_ring_get_buffer_damage(&pMonitor->damage, m_iLastBufferAge, damage.pixman());
|
wlr_damage_ring_get_buffer_damage(&pMonitor->damage, m_iLastBufferAge, damage.pixman());
|
||||||
|
|
||||||
pMonitor->renderingActive = true;
|
pMonitor->renderingActive = true;
|
||||||
|
|
Loading…
Reference in a new issue