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:
Abílio Costa 2024-02-17 02:09:12 +00:00 committed by GitHub
parent fbf5ba87ce
commit e3e7e1fdda
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 5 deletions

View file

@ -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);
} }

View file

@ -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;