fix new blur optimizations with non-full damage

This commit is contained in:
vaxerski 2022-08-01 20:18:26 +02:00
parent e794de1f4d
commit 024752bbe3
3 changed files with 22 additions and 0 deletions

View file

@ -153,6 +153,8 @@ void Events::listener_monitorFrame(void* owner, void* data) {
return;
}
g_pHyprOpenGL->preRender(PMONITOR);
if (!wlr_output_damage_attach_render(PMONITOR->damage, &hasChanged, &damage)){
Debug::log(ERR, "Couldn't attach render to display %s ???", PMONITOR->szName.c_str());
return;

View file

@ -579,6 +579,25 @@ void CHyprOpenGLImpl::markBlurDirtyForMonitor(CMonitor* pMonitor) {
m_mMonitorRenderResources[pMonitor].blurFBDirty = true;
}
void CHyprOpenGLImpl::preRender(CMonitor* pMonitor) {
static auto *const PBLURNEWOPTIMIZE = &g_pConfigManager->getConfigValuePtr("decoration:blur_new_optimizations")->intValue;
if (!*PBLURNEWOPTIMIZE || !m_mMonitorRenderResources[pMonitor].blurFBDirty)
return;
bool has = false;
for (auto& w : g_pCompositor->m_vWindows) {
if (w->m_iWorkspaceID == pMonitor->activeWorkspace && w->m_bIsMapped && !w->m_bHidden && !w->m_bIsFloating) {
has = true;
break;
}
}
if (has)
g_pHyprRenderer->damageMonitor(pMonitor);
}
void CHyprOpenGLImpl::preBlurForCurrentMonitor() {
// make the fake dmg

View file

@ -88,6 +88,7 @@ public:
void markBlurDirtyForMonitor(CMonitor*);
void preWindowPass();
void preRender(CMonitor*);
SCurrentRenderData m_RenderData;