aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2023-08-08 20:01:11 +0200
committervaxerski <[email protected]>2023-08-08 20:01:11 +0200
commitff3fdf1e8cb6c6583425221cc8f34776e81dd571 (patch)
tree1c604c9e4e3df59cee8cb0c0e6fe57288f003cc0
parent8e04a80e60983f5def26bdcaea701040fea9a7ae (diff)
downloadHyprland-ff3fdf1e8cb6c6583425221cc8f34776e81dd571.tar.gz
Hyprland-ff3fdf1e8cb6c6583425221cc8f34776e81dd571.zip
implement a hyprland damage ring
-rw-r--r--src/events/Layers.cpp12
-rw-r--r--src/events/Monitors.cpp2
-rw-r--r--src/events/Windows.cpp2
-rw-r--r--src/helpers/DamageRing.cpp50
-rw-r--r--src/helpers/DamageRing.hpp22
-rw-r--r--src/helpers/Monitor.cpp33
-rw-r--r--src/helpers/Monitor.hpp7
-rw-r--r--src/helpers/SubsurfaceTree.cpp9
-rw-r--r--src/render/Renderer.cpp57
-rw-r--r--src/render/Renderer.hpp14
10 files changed, 117 insertions, 91 deletions
diff --git a/src/events/Layers.cpp b/src/events/Layers.cpp
index 01849867..aded11dd 100644
--- a/src/events/Layers.cpp
+++ b/src/events/Layers.cpp
@@ -97,7 +97,7 @@ void Events::listener_destroyLayerSurface(void* owner, void* data) {
// and damage
wlr_box geomFixed = {layersurface->geometry.x + PMONITOR->vecPosition.x, layersurface->geometry.y + PMONITOR->vecPosition.y, layersurface->geometry.width,
layersurface->geometry.height};
- g_pHyprRenderer->damageBox(&geomFixed);
+ g_pHyprRenderer->damageBox(&geomFixed, layersurface->forceBlur);
}
layersurface->readyToDelete = true;
@@ -156,7 +156,7 @@ void Events::listener_mapLayerSurface(void* owner, void* data) {
wlr_box geomFixed = {layersurface->geometry.x + PMONITOR->vecPosition.x, layersurface->geometry.y + PMONITOR->vecPosition.y, layersurface->geometry.width,
layersurface->geometry.height};
- g_pHyprRenderer->damageBox(&geomFixed);
+ g_pHyprRenderer->damageBox(&geomFixed, layersurface->forceBlur);
const auto WORKSPACE = g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace);
const bool FULLSCREEN = WORKSPACE->m_bHasFullscreenWindow && WORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL;
@@ -245,11 +245,11 @@ void Events::listener_unmapLayerSurface(void* owner, void* data) {
wlr_box geomFixed = {layersurface->geometry.x + PMONITOR->vecPosition.x, layersurface->geometry.y + PMONITOR->vecPosition.y, layersurface->geometry.width,
layersurface->geometry.height};
- g_pHyprRenderer->damageBox(&geomFixed);
+ g_pHyprRenderer->damageBox(&geomFixed, layersurface->forceBlur);
geomFixed = {layersurface->geometry.x + (int)PMONITOR->vecPosition.x, layersurface->geometry.y + (int)PMONITOR->vecPosition.y,
(int)layersurface->layerSurface->surface->current.width, (int)layersurface->layerSurface->surface->current.height};
- g_pHyprRenderer->damageBox(&geomFixed);
+ g_pHyprRenderer->damageBox(&geomFixed, layersurface->forceBlur);
}
void Events::listener_commitLayerSurface(void* owner, void* data) {
@@ -267,7 +267,7 @@ void Events::listener_commitLayerSurface(void* owner, void* data) {
g_pHyprOpenGL->markBlurDirtyForMonitor(PMONITOR); // so that blur is recalc'd
wlr_box geomFixed = {layersurface->geometry.x, layersurface->geometry.y, layersurface->geometry.width, layersurface->geometry.height};
- g_pHyprRenderer->damageBox(&geomFixed);
+ g_pHyprRenderer->damageBox(&geomFixed, layersurface->forceBlur);
// fix if it changed its mon
if ((uint64_t)layersurface->monitorID != PMONITOR->ID) {
@@ -337,7 +337,7 @@ void Events::listener_commitLayerSurface(void* owner, void* data) {
layersurface->keyboardExclusive = layersurface->layerSurface->current.keyboard_interactive;
- g_pHyprRenderer->damageSurface(layersurface->layerSurface->surface, layersurface->position.x, layersurface->position.y);
+ g_pHyprRenderer->damageSurface(layersurface->layerSurface->surface, layersurface->position.x, layersurface->position.y, 1, layersurface->forceBlur);
g_pProtocolManager->m_pFractionalScaleProtocolManager->setPreferredScaleForSurface(layersurface->layerSurface->surface, PMONITOR->scale);
}
diff --git a/src/events/Monitors.cpp b/src/events/Monitors.cpp
index 5e87c4fb..d6162d58 100644
--- a/src/events/Monitors.cpp
+++ b/src/events/Monitors.cpp
@@ -203,7 +203,7 @@ void Events::listener_monitorDamage(void* owner, void* data) {
const auto PMONITOR = (CMonitor*)owner;
const auto E = (wlr_output_event_damage*)data;
- PMONITOR->addDamage(E->damage);
+ PMONITOR->addDamage(const_cast<pixman_region32_t*>(E->damage));
}
void Events::listener_monitorNeedsFrame(void* owner, void* data) {
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp
index 4c901356..85d3ade9 100644
--- a/src/events/Windows.cpp
+++ b/src/events/Windows.cpp
@@ -753,7 +753,7 @@ void Events::listener_commitWindow(void* owner, void* data) {
PWINDOW->updateSurfaceOutputs();
g_pHyprRenderer->damageSurface(PWINDOW->m_pWLSurface.wlr(), PWINDOW->m_vRealPosition.goalv().x, PWINDOW->m_vRealPosition.goalv().y,
- PWINDOW->m_bIsX11 ? 1.0 / PWINDOW->m_fX11SurfaceScaledBy : 1.0);
+ PWINDOW->m_bIsX11 ? 1.0 / PWINDOW->m_fX11SurfaceScaledBy : 1.0, !PWINDOW->opaque());
if (PWINDOW->m_bIsX11 || !PWINDOW->m_bIsFloating || PWINDOW->m_bIsFullscreen)
return;
diff --git a/src/helpers/DamageRing.cpp b/src/helpers/DamageRing.cpp
new file mode 100644
index 00000000..37230186
--- /dev/null
+++ b/src/helpers/DamageRing.cpp
@@ -0,0 +1,50 @@
+#include "DamageRing.hpp"
+#include "../config/ConfigManager.hpp"
+
+CRegion CDamageRing::getDamage(int age) {
+ if (age <= 0 || age - 1 > DAMAGE_RING_LENGTH)
+ return CRegion{0, 0, m_vBounds.x, m_vBounds.y};
+
+ CRegion toReturn = m_aBlurDamageFrames[0];
+ toReturn.add(m_aBlurDamageFrames[1]);
+
+ static auto* const PBLURENABLED = &g_pConfigManager->getConfigValuePtr("decoration:blur:enabled")->intValue;
+ static auto* const PBLURSIZE = &g_pConfigManager->getConfigValuePtr("decoration:blur:size")->intValue;
+ static auto* const PBLURPASSES = &g_pConfigManager->getConfigValuePtr("decoration:blur:passes")->intValue;
+ const auto BLURRADIUS = *PBLURPASSES > 10 ? pow(2, 15) : std::clamp(*PBLURSIZE, (int64_t)1, (int64_t)40) * pow(2, *PBLURPASSES);
+
+ if (*PBLURENABLED)
+ wlr_region_expand(toReturn.pixman(), toReturn.pixman(), BLURRADIUS);
+
+ toReturn.add(m_aDamageFrames[0]);
+ toReturn.add(m_aDamageFrames[1]);
+
+ return toReturn;
+}
+
+void CDamageRing::setBounds(const Vector2D& max) {
+ m_vBounds = max;
+}
+
+void CDamageRing::damageEntire() {
+ m_aDamageFrames[0].add({0, 0, m_vBounds.x, m_vBounds.y});
+}
+
+void CDamageRing::addDamage(const CRegion& damage, bool blur) {
+ if (blur)
+ m_aBlurDamageFrames[0].add(damage);
+ else
+ m_aDamageFrames[0].add(damage);
+}
+
+void CDamageRing::rotate() {
+ m_aBlurDamageFrames[1] = m_aBlurDamageFrames[0];
+ m_aDamageFrames[1] = m_aDamageFrames[0];
+
+ m_aBlurDamageFrames[0].clear();
+ m_aDamageFrames[0].clear();
+}
+
+bool CDamageRing::empty() {
+ return m_aBlurDamageFrames[0].empty() && m_aBlurDamageFrames[1].empty() && m_aDamageFrames[0].empty() && m_aDamageFrames[1].empty();
+} \ No newline at end of file
diff --git a/src/helpers/DamageRing.hpp b/src/helpers/DamageRing.hpp
new file mode 100644
index 00000000..7d552de0
--- /dev/null
+++ b/src/helpers/DamageRing.hpp
@@ -0,0 +1,22 @@
+#pragma once
+
+#include "Region.hpp"
+#include "Vector2D.hpp"
+#include <array>
+
+#define DAMAGE_RING_LENGTH 2
+
+class CDamageRing {
+ public:
+ CRegion getDamage(int age);
+ void setBounds(const Vector2D& max);
+ void damageEntire();
+ void addDamage(const CRegion& damage, bool blur = false);
+ void rotate();
+ bool empty();
+
+ private:
+ Vector2D m_vBounds;
+ std::array<CRegion, DAMAGE_RING_LENGTH> m_aDamageFrames;
+ std::array<CRegion, DAMAGE_RING_LENGTH> m_aBlurDamageFrames;
+}; \ No newline at end of file
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp
index a860585d..125a6e16 100644
--- a/src/helpers/Monitor.cpp
+++ b/src/helpers/Monitor.cpp
@@ -8,12 +8,9 @@ int ratHandler(void* data) {
return 1;
}
-CMonitor::CMonitor() {
- wlr_damage_ring_init(&damage);
-}
+CMonitor::CMonitor() {}
CMonitor::~CMonitor() {
- wlr_damage_ring_finish(&damage);
hyprListener_monitorDestroy.removeCallback();
hyprListener_monitorFrame.removeCallback();
@@ -138,7 +135,7 @@ void CMonitor::onConnect(bool noRule) {
if (!noRule)
g_pHyprRenderer->applyMonitorRule(this, &monitorRule, true);
- wlr_damage_ring_set_bounds(&damage, vecTransformedSize.x, vecTransformedSize.y);
+ damage.setBounds(vecTransformedSize);
wlr_xcursor_manager_load(g_pCompositor->m_sWLRXCursorMgr, scale);
@@ -318,30 +315,8 @@ void CMonitor::onDisconnect() {
std::erase_if(g_pCompositor->m_vMonitors, [&](std::shared_ptr<CMonitor>& el) { return el.get() == this; });
}
-void CMonitor::addDamage(const pixman_region32_t* rg) {
- static auto* const PZOOMFACTOR = &g_pConfigManager->getConfigValuePtr("misc:cursor_zoom_factor")->floatValue;
- 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))
- g_pCompositor->scheduleFrameForMonitor(this);
-}
-
-void CMonitor::addDamage(const CRegion* rg) {
- addDamage(const_cast<CRegion*>(rg)->pixman());
-}
-
-void CMonitor::addDamage(const wlr_box* box) {
- static auto* const PZOOMFACTOR = &g_pConfigManager->getConfigValuePtr("misc:cursor_zoom_factor")->floatValue;
- if (*PZOOMFACTOR != 1.f && g_pCompositor->getMonitorFromCursor() == this) {
- wlr_damage_ring_add_whole(&damage);
- g_pCompositor->scheduleFrameForMonitor(this);
- }
-
- if (wlr_damage_ring_add_box(&damage, box))
- g_pCompositor->scheduleFrameForMonitor(this);
+void CMonitor::addDamage(const CRegion& rg, bool blur) {
+ damage.addDamage(rg, blur);
}
bool CMonitor::isMirror() {
diff --git a/src/helpers/Monitor.hpp b/src/helpers/Monitor.hpp
index b453bc8c..b9971c6e 100644
--- a/src/helpers/Monitor.hpp
+++ b/src/helpers/Monitor.hpp
@@ -9,6 +9,7 @@
#include <xf86drmMode.h>
#include "Timer.hpp"
#include "Region.hpp"
+#include "DamageRing.hpp"
struct SMonitorRule;
@@ -36,7 +37,7 @@ class CMonitor {
drmModeModeInfo customDrmMode = {};
// WLR stuff
- wlr_damage_ring damage;
+ CDamageRing damage;
wlr_output* output = nullptr;
float refreshRate = 60;
int framesToSkip = 0;
@@ -84,9 +85,7 @@ class CMonitor {
// methods
void onConnect(bool noRule);
void onDisconnect();
- void addDamage(const pixman_region32_t* rg);
- void addDamage(const CRegion* rg);
- void addDamage(const wlr_box* box);
+ void addDamage(const CRegion& rg, bool blur = false);
void setMirror(const std::string&);
bool isMirror();
float getDefaultScale();
diff --git a/src/helpers/SubsurfaceTree.cpp b/src/helpers/SubsurfaceTree.cpp
index 7058d32e..1906fd02 100644
--- a/src/helpers/SubsurfaceTree.cpp
+++ b/src/helpers/SubsurfaceTree.cpp
@@ -107,7 +107,7 @@ void SubsurfaceTree::destroySurfaceTree(SSurfaceTreeNode* pNode) {
extents.x += lx;
extents.y += ly;
- g_pHyprRenderer->damageBox(&extents);
+ g_pHyprRenderer->damageBox(&extents, !pNode->pSurface->wlr()->opaque);
}
// remove references to this node
@@ -203,7 +203,7 @@ void Events::listener_unmapSubsurface(void* owner, void* data) {
extents.width = PNODE->pSurface->wlr()->current.width;
extents.height = PNODE->pSurface->wlr()->current.height;
- g_pHyprRenderer->damageBox(&extents);
+ g_pHyprRenderer->damageBox(&extents, !PNODE->pSurface->wlr()->opaque);
}
// SubsurfaceTree::destroySurfaceTree(subsurface->pChild);
@@ -239,12 +239,13 @@ void Events::listener_commitSubsurface(void* owner, void* data) {
const auto NODECOORDS = pNode->pSubsurface ? Vector2D(pNode->pSubsurface->pSubsurface->current.x, pNode->pSubsurface->pSubsurface->current.y) : Vector2D();
if (&cs != pNode->pSubsurface && cs.pSubsurface) {
- g_pHyprRenderer->damageSurface(cs.pSubsurface->surface, lx - NODECOORDS.x + cs.pSubsurface->current.x, ly - NODECOORDS.y + cs.pSubsurface->current.y, SCALE);
+ g_pHyprRenderer->damageSurface(cs.pSubsurface->surface, lx - NODECOORDS.x + cs.pSubsurface->current.x, ly - NODECOORDS.y + cs.pSubsurface->current.y, SCALE,
+ !cs.pSubsurface->surface->opaque);
}
}
if (pNode->pSurface && pNode->pSurface->exists())
- g_pHyprRenderer->damageSurface(pNode->pSurface->wlr(), lx, ly, SCALE);
+ g_pHyprRenderer->damageSurface(pNode->pSurface->wlr(), lx, ly, SCALE, !pNode->pSurface->wlr()->opaque);
}
void Events::listener_destroySubsurface(void* owner, void* data) {
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index aaa15b86..5e64f02c 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -930,7 +930,7 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
// check the damage
CRegion damage;
- bool hasChanged = pMonitor->output->needs_frame || pixman_region32_not_empty(&pMonitor->damage.current);
+ bool hasChanged = pMonitor->output->needs_frame || !pMonitor->damage.empty();
int bufferAge;
if (!hasChanged && *PDAMAGETRACKINGMODE != DAMAGE_TRACKING_NONE && pMonitor->forceFullFrames == 0 && damageBlinkCleanup == 0)
@@ -956,7 +956,7 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
return;
}
- wlr_damage_ring_get_buffer_damage(&pMonitor->damage, bufferAge, damage.pixman());
+ damage = pMonitor->damage.getDamage(bufferAge);
pMonitor->renderingActive = true;
@@ -967,30 +967,11 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
if (*PDAMAGETRACKINGMODE == DAMAGE_TRACKING_NONE || *PDAMAGETRACKINGMODE == DAMAGE_TRACKING_MONITOR || pMonitor->forceFullFrames > 0 || damageBlinkCleanup > 0 ||
pMonitor->isMirror() /* why??? */) {
- damage = {0, 0, (int)pMonitor->vecTransformedSize.x * 10, (int)pMonitor->vecTransformedSize.y * 10};
- pMonitor->lastFrameDamage = damage;
- } else {
- static auto* const PBLURENABLED = &g_pConfigManager->getConfigValuePtr("decoration:blur:enabled")->intValue;
-
- // if we use blur we need to expand the damage for proper blurring
- if (*PBLURENABLED == 1) {
- // TODO: can this be optimized?
- static auto* const PBLURSIZE = &g_pConfigManager->getConfigValuePtr("decoration:blur:size")->intValue;
- static auto* const PBLURPASSES = &g_pConfigManager->getConfigValuePtr("decoration:blur:passes")->intValue;
- const auto BLURRADIUS =
- *PBLURPASSES > 10 ? pow(2, 15) : std::clamp(*PBLURSIZE, (int64_t)1, (int64_t)40) * pow(2, *PBLURPASSES); // is this 2^pass? I don't know but it works... I think.
-
- // now, prep the damage, get the extended damage region
- wlr_region_expand(damage.pixman(), damage.pixman(), BLURRADIUS); // expand for proper blurring
-
- pMonitor->lastFrameDamage = damage;
-
- wlr_region_expand(damage.pixman(), damage.pixman(), BLURRADIUS); // expand for proper blurring 2
- } else {
- pMonitor->lastFrameDamage = damage;
- }
+ damage = {0, 0, (int)pMonitor->vecTransformedSize.x * 10, (int)pMonitor->vecTransformedSize.y * 10};
}
+ pMonitor->lastFrameDamage = damage;
+
if (pMonitor->forceFullFrames > 0) {
pMonitor->forceFullFrames -= 1;
if (pMonitor->forceFullFrames > 10)
@@ -1105,7 +1086,7 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
return;
}
- wlr_damage_ring_rotate(&pMonitor->damage);
+ pMonitor->damage.rotate();
if (UNLOCK_SC)
wlr_output_lock_software_cursors(pMonitor->output, false);
@@ -1414,7 +1395,7 @@ void CHyprRenderer::arrangeLayersForMonitor(const int& monitor) {
PMONITOR->vecReservedBottomRight.x, PMONITOR->vecReservedBottomRight.y);
}
-void CHyprRenderer::damageSurface(wlr_surface* pSurface, double x, double y, double scale) {
+void CHyprRenderer::damageSurface(wlr_surface* pSurface, double x, double y, double scale, bool blur) {
if (!pSurface)
return; // wut?
@@ -1448,7 +1429,7 @@ void CHyprRenderer::damageSurface(wlr_surface* pSurface, double x, double y, dou
wlr_region_scale(damageBoxForEach.pixman(), damageBoxForEach.pixman(), m->scale);
damageBoxForEach.translate({lx + m->vecPosition.x, ly + m->vecPosition.y});
- m->addDamage(&damageBoxForEach);
+ m->addDamage(damageBoxForEach, blur);
}
static auto* const PLOGDAMAGE = &g_pConfigManager->getConfigValuePtr("debug:log_damage")->intValue;
@@ -1466,7 +1447,7 @@ void CHyprRenderer::damageWindow(CWindow* pWindow) {
for (auto& m : g_pCompositor->m_vMonitors) {
wlr_box fixedDamageBox = {damageBox.x - m->vecPosition.x, damageBox.y - m->vecPosition.y, damageBox.width, damageBox.height};
scaleBox(&fixedDamageBox, m->scale);
- m->addDamage(&fixedDamageBox);
+ m->addDamage(&fixedDamageBox, !pWindow->opaque() && !pWindow->m_sAdditionalConfigData.forceNoBlur.toUnderlying());
}
for (auto& wd : pWindow->m_dWindowDecorations)
@@ -1483,7 +1464,7 @@ void CHyprRenderer::damageMonitor(CMonitor* pMonitor) {
return;
wlr_box damageBox = {0, 0, INT16_MAX, INT16_MAX};
- pMonitor->addDamage(&damageBox);
+ pMonitor->addDamage(&damageBox, false);
static auto* const PLOGDAMAGE = &g_pConfigManager->getConfigValuePtr("debug:log_damage")->intValue;
@@ -1491,7 +1472,7 @@ void CHyprRenderer::damageMonitor(CMonitor* pMonitor) {
Debug::log(LOG, "Damage: Monitor %s", pMonitor->szName.c_str());
}
-void CHyprRenderer::damageBox(wlr_box* pBox) {
+void CHyprRenderer::damageBox(wlr_box* pBox, bool blur) {
if (g_pCompositor->m_bUnsafeState)
return;
@@ -1501,7 +1482,7 @@ void CHyprRenderer::damageBox(wlr_box* pBox) {
wlr_box damageBox = {pBox->x - m->vecPosition.x, pBox->y - m->vecPosition.y, pBox->width, pBox->height};
scaleBox(&damageBox, m->scale);
- m->addDamage(&damageBox);
+ m->addDamage(&damageBox, blur);
}
static auto* const PLOGDAMAGE = &g_pConfigManager->getConfigValuePtr("debug:log_damage")->intValue;
@@ -1510,14 +1491,14 @@ void CHyprRenderer::damageBox(wlr_box* pBox) {
Debug::log(LOG, "Damage: Box: xy: %d, %d wh: %d, %d", pBox->x, pBox->y, pBox->width, pBox->height);
}
-void CHyprRenderer::damageBox(const int& x, const int& y, const int& w, const int& h) {
+void CHyprRenderer::damageBox(const int& x, const int& y, const int& w, const int& h, bool blur) {
wlr_box box = {x, y, w, h};
- damageBox(&box);
+ damageBox(&box, blur);
}
-void CHyprRenderer::damageRegion(const CRegion& rg) {
+void CHyprRenderer::damageRegion(const CRegion& rg, bool blur) {
for (auto& RECT : rg.getRects()) {
- damageBox(RECT.x1, RECT.y1, RECT.x2 - RECT.x1, RECT.y2 - RECT.y1);
+ damageBox(RECT.x1, RECT.y1, RECT.x2 - RECT.x1, RECT.y2 - RECT.y1, blur);
}
}
@@ -1527,7 +1508,7 @@ void CHyprRenderer::damageMirrorsWith(CMonitor* pMonitor, const CRegion& pRegion
CRegion rg{pRegion};
wlr_region_scale_xy(rg.pixman(), rg.pixman(), scale.x, scale.y);
- pMonitor->addDamage(&rg);
+ pMonitor->addDamage(rg, false);
g_pCompositor->scheduleFrameForMonitor(mirror);
}
@@ -1899,14 +1880,14 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR
if (!pMonitor->isMirror())
wlr_output_layout_add(g_pCompositor->m_sWLROutputLayout, pMonitor->output, (int)pMonitor->vecPosition.x, (int)pMonitor->vecPosition.y);
- wlr_damage_ring_set_bounds(&pMonitor->damage, pMonitor->vecTransformedSize.x, pMonitor->vecTransformedSize.y);
-
// updato us
arrangeLayersForMonitor(pMonitor->ID);
// frame skip
pMonitor->framesToSkip = 1;
+ pMonitor->damage.setBounds(pMonitor->vecTransformedSize);
+
// reload to fix mirrors
g_pConfigManager->m_bWantsMonitorReload = true;
diff --git a/src/render/Renderer.hpp b/src/render/Renderer.hpp
index badd4a45..8008a2ef 100644
--- a/src/render/Renderer.hpp
+++ b/src/render/Renderer.hpp
@@ -12,16 +12,14 @@
struct SMonitorRule;
// TODO: add fuller damage tracking for updating only parts of a window
-enum DAMAGETRACKINGMODES
-{
+enum DAMAGETRACKINGMODES {
DAMAGE_TRACKING_INVALID = -1,
DAMAGE_TRACKING_NONE = 0,
DAMAGE_TRACKING_MONITOR,
DAMAGE_TRACKING_FULL
};
-enum eRenderPassMode
-{
+enum eRenderPassMode {
RENDER_PASS_ALL = 0,
RENDER_PASS_MAIN,
RENDER_PASS_POPUP
@@ -36,11 +34,11 @@ class CHyprRenderer {
void renderMonitor(CMonitor* pMonitor);
void outputMgrApplyTest(wlr_output_configuration_v1*, bool);
void arrangeLayersForMonitor(const int&);
- void damageSurface(wlr_surface*, double, double, double scale = 1.0);
+ void damageSurface(wlr_surface*, double, double, double scale = 1.0, bool blur = false);
void damageWindow(CWindow*);
- void damageBox(wlr_box*);
- void damageBox(const int& x, const int& y, const int& w, const int& h);
- void damageRegion(const CRegion&);
+ void damageBox(wlr_box*, bool blur = false);
+ void damageBox(const int& x, const int& y, const int& w, const int& h, bool blur = false);
+ void damageRegion(const CRegion&, bool blur = false);
void damageMonitor(CMonitor*);
void damageMirrorsWith(CMonitor*, const CRegion&);
bool applyMonitorRule(CMonitor*, SMonitorRule*, bool force = false);