summaryrefslogtreecommitdiff
path: root/src/helpers/Monitor.cpp
diff options
context:
space:
mode:
authorAbĂ­lio Costa <abmantis@users.noreply.github.com>2024-02-17 02:09:12 +0000
committerGitHub <noreply@github.com>2024-02-17 02:09:12 +0000
commite3e7e1fdda7660a70bd206aa3ed6a45bb4000376 (patch)
tree1805ec97c0d395016cc1abc663a1f976770cae84 /src/helpers/Monitor.cpp
parentfbf5ba87ce57752653f3bebf6e2be090c702836e (diff)
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>
Diffstat (limited to 'src/helpers/Monitor.cpp')
-rw-r--r--src/helpers/Monitor.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp
index 08ccb05d..97bdf59a 100644
--- a/src/helpers/Monitor.cpp
+++ b/src/helpers/Monitor.cpp
@@ -320,9 +320,7 @@ void CMonitor::addDamage(const pixman_region32_t* rg) {
if (*PZOOMFACTOR != 1.f && g_pCompositor->getMonitorFromCursor() == this) {
wlr_damage_ring_add_whole(&damage);
g_pCompositor->scheduleFrameForMonitor(this);
- }
-
- if (wlr_damage_ring_add(&damage, rg))
+ } else if (wlr_damage_ring_add(&damage, rg))
g_pCompositor->scheduleFrameForMonitor(this);
}