From 4211b37e22791793cb948e447e2ba4d798af3859 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 30 Jul 2022 22:26:46 +0200 Subject: [PATCH] added misc:damage_entire_on_snapshot --- src/config/ConfigManager.cpp | 1 + src/render/OpenGL.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index d34fbb29..7fb2d267 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -51,6 +51,7 @@ void CConfigManager::setDefaultVars() { configValues["misc:disable_hyprland_logo"].intValue = 0; configValues["misc:disable_splash_rendering"].intValue = 0; configValues["misc:no_vfr"].intValue = 1; + configValues["misc:damage_entire_on_snapshot"].intValue = 0; configValues["debug:int"].intValue = 0; configValues["debug:log_damage"].intValue = 0; diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp index c0083be8..0af18343 100644 --- a/src/render/OpenGL.cpp +++ b/src/render/OpenGL.cpp @@ -872,6 +872,11 @@ void CHyprOpenGLImpl::renderSnapshot(CWindow** pWindow) { renderTextureInternalWithDamage(it->second.m_cTex, &windowBox, PWINDOW->m_fAlpha.fl(), &fakeDamage, 0); pixman_region32_fini(&fakeDamage); + + static auto *const PDAMAGEMON = &g_pConfigManager->getConfigValuePtr("misc:damage_entire_on_snapshot")->intValue; + + if (*PDAMAGEMON) + PMONITOR->forceFullFrames += 1; } void CHyprOpenGLImpl::renderSnapshot(SLayerSurface** pLayer) { @@ -898,6 +903,11 @@ void CHyprOpenGLImpl::renderSnapshot(SLayerSurface** pLayer) { renderTextureInternalWithDamage(it->second.m_cTex, &windowBox, PLAYER->alpha.fl(), &fakeDamage, 0); pixman_region32_fini(&fakeDamage); + + static auto *const PDAMAGEMON = &g_pConfigManager->getConfigValuePtr("misc:damage_entire_on_snapshot")->intValue; + + if (*PDAMAGEMON) + PMONITOR->forceFullFrames += 1; } void CHyprOpenGLImpl::renderRoundedShadow(wlr_box* box, int round, int range, float a) {