Skip to content

Commit

Permalink
opengl: check for introspection on special_blur
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski committed Nov 25, 2023
1 parent 98c7ba4 commit ad3f688
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/render/OpenGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,10 @@ GLuint CHyprOpenGLImpl::compileShader(const GLuint& type, std::string src, bool
bool CHyprOpenGLImpl::passRequiresIntrospection(CMonitor* pMonitor) {
// passes requiring introspection are the ones that need to render blur.

static auto* const PBLUR = &g_pConfigManager->getConfigValuePtr("decoration:blur:enabled")->intValue;
static auto* const PXRAY = &g_pConfigManager->getConfigValuePtr("decoration:blur:xray")->intValue;
static auto* const POPTIM = &g_pConfigManager->getConfigValuePtr("decoration:blur:new_optimizations")->intValue;
static auto* const PBLUR = &g_pConfigManager->getConfigValuePtr("decoration:blur:enabled")->intValue;
static auto* const PXRAY = &g_pConfigManager->getConfigValuePtr("decoration:blur:xray")->intValue;
static auto* const POPTIM = &g_pConfigManager->getConfigValuePtr("decoration:blur:new_optimizations")->intValue;
static auto* const PBLURSPECIAL = &g_pConfigManager->getConfigValuePtr("decoration:blur:special")->intValue;

if (*PBLUR == 0)
return false;
Expand All @@ -143,6 +144,18 @@ bool CHyprOpenGLImpl::passRequiresIntrospection(CMonitor* pMonitor) {
return true;
}

if (*PBLURSPECIAL) {
for (auto& ws : g_pCompositor->m_vWorkspaces) {
if (!ws->m_bIsSpecialWorkspace || ws->m_iMonitorID != pMonitor->ID)
continue;

if (ws->m_fAlpha.fl() == 0)
continue;

return true;
}
}

if (*PXRAY)
return false;

Expand Down

0 comments on commit ad3f688

Please sign in to comment.